Skip to content
This repository was archived by the owner on Mar 13, 2020. It is now read-only.

Commit 9ac114a

Browse files
author
eteplus
committed
vue-sui-demo v0.1.1
1 parent 60e4bf9 commit 9ac114a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3173
-20
lines changed

.babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": ["es2015", "stage-2"],
3+
"plugins": ["transform-runtime"],
4+
"comments": false
5+
}

.eslintrc

+180
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true
5+
},
6+
"ecmaFeatures": {
7+
"arrowFunctions": true,
8+
"destructuring": true,
9+
"classes": true,
10+
"defaultParams": true,
11+
"blockBindings": true,
12+
"modules": true,
13+
"objectLiteralComputedProperties": true,
14+
"objectLiteralShorthandMethods": true,
15+
"objectLiteralShorthandProperties": true,
16+
"restParams": true,
17+
"spread": true,
18+
"forOf": true,
19+
"generators": true,
20+
"templateStrings": true,
21+
"superInFunctions": true,
22+
"experimentalObjectRestSpread": true
23+
},
24+
25+
"rules": {
26+
"accessor-pairs": 2,
27+
"array-bracket-spacing": 0,
28+
"block-scoped-var": 0,
29+
"brace-style": [2, "allman", { "allowSingleLine": true }],
30+
"camelcase": 0,
31+
"comma-dangle": [2, "never"],
32+
"comma-spacing": [2, { "before": false, "after": true }],
33+
"comma-style": [2, "last"],
34+
"complexity": 0,
35+
"computed-property-spacing": 0,
36+
"consistent-return": 0,
37+
"consistent-this": 0,
38+
"constructor-super": 2,
39+
"curly": [2, "multi-line"],
40+
"default-case": 0,
41+
"dot-location": [2, "property"],
42+
"dot-notation": 0,
43+
"eol-last": 2,
44+
"eqeqeq": [2, "allow-null"],
45+
"func-names": 0,
46+
"func-style": 0,
47+
"generator-star-spacing": [2, { "before": true, "after": true }],
48+
"guard-for-in": 0,
49+
"handle-callback-err": [2, "^(err|error)$" ],
50+
"indent": [2, 2, { "SwitchCase": 1 }],
51+
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
52+
"linebreak-style": 0,
53+
"lines-around-comment": 0,
54+
"max-nested-callbacks": 0,
55+
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
56+
"new-parens": 2,
57+
"newline-after-var": 0,
58+
"no-alert": 0,
59+
"no-array-constructor": 2,
60+
"no-caller": 2,
61+
"no-catch-shadow": 0,
62+
"no-cond-assign": 2,
63+
"no-console": 0,
64+
"no-constant-condition": 0,
65+
"no-continue": 0,
66+
"no-control-regex": 2,
67+
"no-debugger": 2,
68+
"no-delete-var": 2,
69+
"no-div-regex": 0,
70+
"no-dupe-args": 2,
71+
"no-dupe-keys": 2,
72+
"no-duplicate-case": 2,
73+
"no-else-return": 0,
74+
"no-empty": 0,
75+
"no-empty-character-class": 2,
76+
"no-empty-label": 2,
77+
"no-eq-null": 0,
78+
"no-eval": 2,
79+
"no-ex-assign": 2,
80+
"no-extend-native": 2,
81+
"no-extra-bind": 2,
82+
"no-extra-boolean-cast": 2,
83+
"no-extra-parens": 0,
84+
"no-extra-semi": 0,
85+
"no-fallthrough": 2,
86+
"no-floating-decimal": 2,
87+
"no-func-assign": 2,
88+
"no-implied-eval": 2,
89+
"no-inline-comments": 0,
90+
"no-inner-declarations": [2, "functions"],
91+
"no-invalid-regexp": 2,
92+
"no-irregular-whitespace": 2,
93+
"no-iterator": 2,
94+
"no-label-var": 2,
95+
"no-labels": 2,
96+
"no-lone-blocks": 2,
97+
"no-lonely-if": 0,
98+
"no-loop-func": 0,
99+
"no-mixed-requires": 0,
100+
"no-mixed-spaces-and-tabs": 2,
101+
"no-multi-spaces": 2,
102+
"no-multi-str": 2,
103+
"no-multiple-empty-lines": [2, { "max": 1 }],
104+
"no-native-reassign": 2,
105+
"no-negated-in-lhs": 2,
106+
"no-nested-ternary": 0,
107+
"no-new": 2,
108+
"no-new-func": 0,
109+
"no-new-object": 2,
110+
"no-new-require": 2,
111+
"no-new-wrappers": 2,
112+
"no-obj-calls": 2,
113+
"no-octal": 2,
114+
"no-octal-escape": 2,
115+
"no-param-reassign": 0,
116+
"no-path-concat": 0,
117+
"no-process-env": 0,
118+
"no-process-exit": 0,
119+
"no-proto": 0,
120+
"no-redeclare": 2,
121+
"no-regex-spaces": 2,
122+
"no-restricted-modules": 0,
123+
"no-return-assign": 2,
124+
"no-script-url": 0,
125+
"no-self-compare": 2,
126+
"no-sequences": 2,
127+
"no-shadow": 0,
128+
"no-shadow-restricted-names": 2,
129+
"no-spaced-func": 2,
130+
"no-sparse-arrays": 2,
131+
"no-sync": 0,
132+
"no-ternary": 0,
133+
"no-this-before-super": 2,
134+
"no-throw-literal": 2,
135+
"no-trailing-spaces": 2,
136+
"no-undef": 2,
137+
"no-undef-init": 2,
138+
"no-undefined": 0,
139+
"no-underscore-dangle": 0,
140+
"no-unexpected-multiline": 2,
141+
"no-unneeded-ternary": 2,
142+
"no-unreachable": 2,
143+
"no-unused-expressions": 0,
144+
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
145+
"no-use-before-define": 0,
146+
"no-var": 0,
147+
"no-void": 0,
148+
"no-warning-comments": 0,
149+
"no-with": 2,
150+
"object-curly-spacing": 0,
151+
"object-shorthand": 0,
152+
"one-var": [2, { "initialized": "never" }],
153+
"operator-assignment": 0,
154+
"operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
155+
"padded-blocks": 0,
156+
"prefer-const": 0,
157+
"quote-props": 0,
158+
"quotes": [2, "single", "avoid-escape"],
159+
"radix": 2,
160+
"semi": [2, "never"],
161+
"semi-spacing": 0,
162+
"sort-vars": 0,
163+
"space-after-keywords": [2, "always"],
164+
"space-before-blocks": [2, "always"],
165+
"space-before-function-paren": [2, "always"],
166+
"space-in-parens": [2, "never"],
167+
"space-infix-ops": 2,
168+
"space-return-throw-case": 2,
169+
"space-unary-ops": [2, { "words": true, "nonwords": false }],
170+
"spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }],
171+
"strict": 0,
172+
"use-isnan": 2,
173+
"valid-jsdoc": 0,
174+
"valid-typeof": 2,
175+
"vars-on-top": 0,
176+
"wrap-iife": [2, "any"],
177+
"wrap-regex": 0,
178+
"yoda": [2, "never"]
179+
}
180+
}

.gitignore

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
1-
# Logs
1+
.DS_Store
22
logs
33
*.log
44
npm-debug.log*
5-
6-
# Runtime data
75
pids
86
*.pid
97
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
128
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
159
coverage
16-
17-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1810
.grunt
19-
20-
# node-waf configuration
2111
.lock-wscript
22-
23-
# Compiled binary addons (http://nodejs.org/api/addons.html)
24-
build/Release
25-
26-
# Dependency directory
12+
dist/
2713
node_modules
28-
29-
# Optional npm cache directory
3014
.npm
31-
32-
# Optional REPL history
3315
.node_repl_history

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
# vue-sui-demo
22
vue 和 sui-mobile 结合的demo,禁用了sui自带的路由,使用vue-router
3+
4+
> Vue-SUI-Demo Project
5+
6+
## Build Setup
7+
8+
``` bash
9+
# install dependencies
10+
npm install
11+
12+
# serve with hot reload at localhost:8080
13+
npm run dev
14+
15+
# build for production with minification
16+
npm run build

build/dev-server.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var path = require('path')
2+
var express = require('express')
3+
var webpack = require('webpack')
4+
var config = require('./webpack.dev.conf')
5+
var favicon = require('express-favicon')
6+
7+
var app = express()
8+
var compiler = webpack(config)
9+
app.use('/lib', express.static(path.join(__dirname, '../src/lib')))
10+
11+
app.use(favicon(path.join(__dirname, '../favicon.ico')))
12+
// handle fallback for HTML5 history API
13+
app.use(require('connect-history-api-fallback')())
14+
15+
// serve webpack bundle output
16+
app.use(require('webpack-dev-middleware')(compiler, {
17+
noInfo: true,
18+
publicPath: config.output.publicPath
19+
}))
20+
21+
// enable hot-reload and state-preserving
22+
// compilation error display
23+
app.use(require('webpack-hot-middleware')(compiler))
24+
25+
app.listen(8000, '127.0.0.1', function(err) {
26+
if (err) {
27+
console.log(err)
28+
return
29+
}
30+
console.log('Listening at http://127.0.0.1:8000')
31+
})

build/webpack.base.conf.js

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
var path = require('path')
2+
3+
module.exports = {
4+
entry: {
5+
app: './src/app.js'
6+
},
7+
output: {
8+
path: path.resolve(__dirname, '../dist/static'),
9+
publicPath: '/static/',
10+
filename: '[name].js'
11+
},
12+
externals: {
13+
// require("jquery") is external and available
14+
// on the global var jQuery
15+
'zepto': 'Zepto'
16+
},
17+
resolve: {
18+
extensions: ['', '.js', '.vue', '.less'],
19+
alias: {
20+
'src': path.resolve(__dirname, '../src')
21+
}
22+
},
23+
resolveLoader: {
24+
root: path.join(__dirname, 'node_modules'),
25+
},
26+
module: {
27+
loaders: [
28+
{
29+
test: /\.vue$/,
30+
loader: 'vue'
31+
},
32+
{
33+
test: /\.js$/,
34+
loader: 'babel!eslint',
35+
exclude: /node_modules|vue\/dist|vue-router\/|vue-loader\/|vue-hot-reload-api\//
36+
},
37+
{
38+
test: /\.json$/,
39+
loader: 'json'
40+
},
41+
{
42+
test: /\.less$/,
43+
loader: 'css!less'
44+
},
45+
{
46+
test: /\.(png|jpg|gif|svg)$/,
47+
loader: 'url',
48+
query: {
49+
limit: 10000,
50+
name: '[name].[ext]?[hash]'
51+
}
52+
}
53+
]
54+
},
55+
vue: {
56+
loaders: {
57+
js: 'babel!eslint',
58+
less: 'vue-style!css!less'
59+
}
60+
},
61+
eslint: {
62+
formatter: require('eslint-friendly-formatter')
63+
}
64+
}

build/webpack.dev.conf.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
var webpack = require('webpack')
2+
var config = require('./webpack.base.conf')
3+
var HtmlWebpackPlugin = require('html-webpack-plugin')
4+
var BrowserSyncPlugin = require('browser-sync-webpack-plugin')
5+
config.devtool = 'eval-source-map'
6+
7+
// add hot-reload related code to entry chunk
8+
config.entry.app = [
9+
'eventsource-polyfill',
10+
'webpack-hot-middleware/client?quiet=true&reload=true',
11+
config.entry.app
12+
]
13+
14+
config.output.publicPath = '/'
15+
16+
config.plugins = (config.plugins || []).concat([
17+
new webpack.optimize.OccurenceOrderPlugin(),
18+
new webpack.HotModuleReplacementPlugin(),
19+
new webpack.NoErrorsPlugin(),
20+
new HtmlWebpackPlugin({
21+
filename: 'index.html',
22+
template: 'src/index.html'
23+
}),
24+
new BrowserSyncPlugin(
25+
// BrowserSync options
26+
{
27+
host: '127.0.0.1',
28+
port: 8080,
29+
proxy: 'http://127.0.0.1:8000/',
30+
logConnections: false,
31+
notify: false
32+
},
33+
// plugin options
34+
{
35+
reload: true
36+
})
37+
])
38+
39+
module.exports = config

0 commit comments

Comments
 (0)