├── .DS_Store ├── README.md ├── vue1.0 ├── .DS_Store ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ ├── prod.env.js │ └── test.env.js ├── index.html ├── package.json ├── src │ ├── .DS_Store │ ├── App.vue │ ├── assets │ │ ├── .DS_Store │ │ ├── .sass-cache │ │ │ └── e792b3c160d449f7dd96d55f12822c161748227f │ │ │ │ ├── reset.scssc │ │ │ │ └── style.scssc │ │ ├── css │ │ │ ├── reset.css │ │ │ ├── reset.css.map │ │ │ ├── style.css │ │ │ └── style.css.map │ │ ├── images │ │ │ ├── .DS_Store │ │ │ ├── chaoshi.jpg │ │ │ ├── close.png │ │ │ ├── food_icon1.png │ │ │ ├── food_icon2.jpeg │ │ │ ├── food_icon3.jpeg │ │ │ ├── food_icon4.png │ │ │ ├── icon1.png │ │ │ ├── img1.jpeg │ │ │ ├── img10.jpeg │ │ │ ├── img2.jpeg │ │ │ ├── img3.jpeg │ │ │ ├── img4.jpeg │ │ │ ├── img5.jpeg │ │ │ ├── img6.jpeg │ │ │ ├── img7.jpeg │ │ │ ├── img8.jpeg │ │ │ ├── img9.jpeg │ │ │ ├── meishi.jpg │ │ │ ├── shuguo.jpg │ │ │ ├── tianpin.jpg │ │ │ ├── xiawu.jpg │ │ │ ├── xindian.jpg │ │ │ ├── zaocan.jpg │ │ │ └── zhunshi.jpg │ │ ├── js │ │ │ ├── .DS_Store │ │ │ └── flexible.js │ │ └── scss │ │ │ ├── .DS_Store │ │ │ ├── reset.scss │ │ │ └── style.scss │ ├── components │ │ ├── .DS_Store │ │ └── header.vue │ ├── json │ │ ├── form.js │ │ ├── nav.js │ │ ├── rate.js │ │ └── section_food.js │ ├── main.js │ ├── router │ │ └── router.js │ └── views │ │ ├── food.vue │ │ ├── login.vue │ │ └── portal.vue ├── static │ ├── .DS_Store │ ├── .gitkeep │ └── images │ │ ├── .DS_Store │ │ ├── chaoshi.jpg │ │ ├── close.png │ │ ├── food_icon1.png │ │ ├── food_icon2.jpeg │ │ ├── food_icon3.jpeg │ │ ├── food_icon4.png │ │ ├── icon1.png │ │ ├── img1.jpeg │ │ ├── img10.jpeg │ │ ├── img2.jpeg │ │ ├── img3.jpeg │ │ ├── img4.jpeg │ │ ├── img5.jpeg │ │ ├── img6.jpeg │ │ ├── img7.jpeg │ │ ├── img8.jpeg │ │ ├── img9.jpeg │ │ ├── meishi.jpg │ │ ├── shuguo.jpg │ │ ├── tianpin.jpg │ │ ├── xiawu.jpg │ │ ├── xindian.jpg │ │ ├── zaocan.jpg │ │ └── zhunshi.jpg └── test │ └── e2e │ ├── custom-assertions │ └── elementCount.js │ ├── nightwatch.conf.js │ ├── runner.js │ └── specs │ └── test.js ├── vue1.4 ├── .babelrc ├── .editorconfig ├── .gitignore ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ ├── prod.env.js │ └── test.env.js ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ ├── .sass-cache │ │ │ ├── dfd83d2e10a14fcce8d1368ac4b44a3560506b74 │ │ │ │ ├── reset.scssc │ │ │ │ └── style.scssc │ │ │ └── e792b3c160d449f7dd96d55f12822c161748227f │ │ │ │ ├── reset.scssc │ │ │ │ └── style.scssc │ │ ├── css │ │ │ ├── reset.css │ │ │ ├── reset.css.map │ │ │ ├── style.css │ │ │ └── style.css.map │ │ ├── images │ │ │ ├── add.png │ │ │ ├── chaoshi.jpg │ │ │ ├── close.png │ │ │ ├── doujiang.jpeg │ │ │ ├── fan1.jpeg │ │ │ ├── fan2.jpeg │ │ │ ├── fan3.jpeg │ │ │ ├── fire.jpeg │ │ │ ├── food_icon1.png │ │ │ ├── food_icon2.jpeg │ │ │ ├── food_icon3.jpeg │ │ │ ├── food_icon4.png │ │ │ ├── hebaodan.jpeg │ │ │ ├── icon1.png │ │ │ ├── img1.jpeg │ │ │ ├── img10.jpeg │ │ │ ├── img2.jpeg │ │ │ ├── img3.jpeg │ │ │ ├── img4.jpeg │ │ │ ├── img5.jpeg │ │ │ ├── img6.jpeg │ │ │ ├── img7.jpeg │ │ │ ├── img8.jpeg │ │ │ ├── img9.jpeg │ │ │ ├── meishi.jpg │ │ │ ├── red.png │ │ │ ├── shuguo.jpg │ │ │ ├── tang.jpeg │ │ │ ├── tianpin.jpg │ │ │ ├── xiawu.jpg │ │ │ ├── xindian.jpg │ │ │ ├── yonghe.jpeg │ │ │ ├── youtiao.jpeg │ │ │ ├── zaocan.jpg │ │ │ └── zhunshi.jpg │ │ ├── js │ │ │ └── flexible.js │ │ └── scss │ │ │ ├── reset.scss │ │ │ └── style.scss │ ├── components │ │ ├── cart.vue │ │ ├── food_head.vue │ │ ├── food_menu.vue │ │ ├── header.vue │ │ ├── header1.vue │ │ └── shop.vue │ ├── main.js │ ├── router │ │ └── router.js │ ├── views │ │ ├── food.vue │ │ ├── login.vue │ │ ├── mall.vue │ │ └── portal.vue │ └── vuex │ │ ├── actions.js │ │ ├── index.js │ │ ├── mutation-types.js │ │ └── mutations.js ├── static │ ├── images │ │ ├── add.png │ │ ├── chaoshi.jpg │ │ ├── close.png │ │ ├── doujiang.jpeg │ │ ├── fan.jpeg │ │ ├── fan1.jpeg │ │ ├── fan2.jpeg │ │ ├── fan3.jpeg │ │ ├── fire.jpeg │ │ ├── food_icon1.png │ │ ├── food_icon2.jpeg │ │ ├── food_icon3.jpeg │ │ ├── food_icon4.png │ │ ├── hebaodan.jpeg │ │ ├── icon1.png │ │ ├── img1.jpeg │ │ ├── img10.jpeg │ │ ├── img2.jpeg │ │ ├── img3.jpeg │ │ ├── img4.jpeg │ │ ├── img5.jpeg │ │ ├── img6.jpeg │ │ ├── img7.jpeg │ │ ├── img8.jpeg │ │ ├── img9.jpeg │ │ ├── meishi.jpg │ │ ├── red.png │ │ ├── shuguo.jpg │ │ ├── tang.jpeg │ │ ├── tianpin.jpg │ │ ├── xiawu.jpg │ │ ├── xindian.jpg │ │ ├── yonghe.jpeg │ │ ├── youtiao.jpeg │ │ ├── zaocan.jpg │ │ └── zhunshi.jpg │ └── json │ │ ├── food.json │ │ ├── header1.json │ │ ├── nav.json │ │ └── rate.json └── test │ └── e2e │ ├── custom-assertions │ └── elementCount.js │ ├── nightwatch.conf.js │ ├── runner.js │ └── specs │ └── test.js ├── vue2.0 ├── .babelrc ├── .editorconfig ├── .gitignore ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── dev-client.js │ ├── dev-server.js │ ├── utils.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ ├── prod.env.js │ └── test.env.js ├── index.html ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ ├── .sass-cache │ │ │ ├── dfd83d2e10a14fcce8d1368ac4b44a3560506b74 │ │ │ │ ├── reset.scssc │ │ │ │ └── style.scssc │ │ │ └── e792b3c160d449f7dd96d55f12822c161748227f │ │ │ │ ├── reset.scssc │ │ │ │ └── style.scssc │ │ ├── css │ │ │ ├── reset.css │ │ │ ├── reset.css.map │ │ │ ├── style.css │ │ │ └── style.css.map │ │ ├── images │ │ │ ├── add.png │ │ │ ├── chaoshi.jpg │ │ │ ├── close.png │ │ │ ├── doujiang.jpeg │ │ │ ├── fan1.jpeg │ │ │ ├── fan2.jpeg │ │ │ ├── fan3.jpeg │ │ │ ├── fire.jpeg │ │ │ ├── food_icon1.png │ │ │ ├── food_icon2.jpeg │ │ │ ├── food_icon3.jpeg │ │ │ ├── food_icon4.png │ │ │ ├── hebaodan.jpeg │ │ │ ├── icon1.png │ │ │ ├── img1.jpeg │ │ │ ├── img10.jpeg │ │ │ ├── img2.jpeg │ │ │ ├── img3.jpeg │ │ │ ├── img4.jpeg │ │ │ ├── img5.jpeg │ │ │ ├── img6.jpeg │ │ │ ├── img7.jpeg │ │ │ ├── img8.jpeg │ │ │ ├── img9.jpeg │ │ │ ├── meishi.jpg │ │ │ ├── red.png │ │ │ ├── shuguo.jpg │ │ │ ├── tang.jpeg │ │ │ ├── tianpin.jpg │ │ │ ├── xiawu.jpg │ │ │ ├── xindian.jpg │ │ │ ├── yonghe.jpeg │ │ │ ├── youtiao.jpeg │ │ │ ├── zaocan.jpg │ │ │ └── zhunshi.jpg │ │ ├── js │ │ │ └── flexible.js │ │ └── scss │ │ │ ├── reset.scss │ │ │ └── style.scss │ ├── components │ │ ├── cart.vue │ │ ├── food_head.vue │ │ ├── food_menu.vue │ │ ├── header.vue │ │ ├── header1.vue │ │ └── shop.vue │ ├── main.js │ ├── router │ │ └── router.js │ ├── views │ │ ├── food.vue │ │ ├── login.vue │ │ ├── mall.vue │ │ └── portal.vue │ └── vuex │ │ ├── actions.js │ │ ├── index.js │ │ ├── mutation-types.js │ │ └── mutations.js ├── static │ ├── images │ │ ├── add.png │ │ ├── back.png │ │ ├── chaoshi.jpg │ │ ├── close.png │ │ ├── doujiang.jpeg │ │ ├── fan.jpeg │ │ ├── fan1.jpeg │ │ ├── fan2.jpeg │ │ ├── fan3.jpeg │ │ ├── fire.jpeg │ │ ├── food_icon1.png │ │ ├── food_icon2.jpeg │ │ ├── food_icon3.jpeg │ │ ├── food_icon4.png │ │ ├── hebaodan.jpeg │ │ ├── icon1.png │ │ ├── img1.jpeg │ │ ├── img10.jpeg │ │ ├── img2.jpeg │ │ ├── img3.jpeg │ │ ├── img4.jpeg │ │ ├── img5.jpeg │ │ ├── img6.jpeg │ │ ├── img7.jpeg │ │ ├── img8.jpeg │ │ ├── img9.jpeg │ │ ├── meishi.jpg │ │ ├── red.png │ │ ├── shuguo.jpg │ │ ├── star_off.png │ │ ├── star_on.png │ │ ├── tang.jpeg │ │ ├── tianpin.jpg │ │ ├── xiawu.jpg │ │ ├── xindian.jpg │ │ ├── yonghe.jpeg │ │ ├── youtiao.jpeg │ │ ├── zaocan.jpg │ │ └── zhunshi.jpg │ └── json │ │ ├── food.json │ │ ├── header1.json │ │ ├── nav.json │ │ └── rate.json └── test │ └── e2e │ ├── custom-assertions │ └── elementCount.js │ ├── nightwatch.conf.js │ ├── runner.js │ └── specs │ └── test.js └── vue2.3 ├── .babelrc ├── .editorconfig ├── .gitignore ├── README.md ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js ├── prod.env.js └── test.env.js ├── index.html ├── package-lock.json ├── package.json ├── src ├── App.vue ├── assets │ ├── .sass-cache │ │ ├── 5718f3d55d4aae51bb90a63baa87aefbb5b8b5a8 │ │ │ ├── reset.scssc │ │ │ └── style.scssc │ │ ├── dfd83d2e10a14fcce8d1368ac4b44a3560506b74 │ │ │ ├── reset.scssc │ │ │ └── style.scssc │ │ └── e792b3c160d449f7dd96d55f12822c161748227f │ │ │ ├── reset.scssc │ │ │ └── style.scssc │ ├── css │ │ ├── reset.css │ │ ├── reset.css.map │ │ ├── style.css │ │ └── style.css.map │ ├── images │ │ ├── add.png │ │ ├── chaoshi.jpg │ │ ├── close.png │ │ ├── doujiang.jpeg │ │ ├── fan1.jpeg │ │ ├── fan2.jpeg │ │ ├── fan3.jpeg │ │ ├── fire.jpeg │ │ ├── food_icon1.png │ │ ├── food_icon2.jpeg │ │ ├── food_icon3.jpeg │ │ ├── food_icon4.png │ │ ├── hebaodan.jpeg │ │ ├── icon1.png │ │ ├── img1.jpeg │ │ ├── img10.jpeg │ │ ├── img2.jpeg │ │ ├── img3.jpeg │ │ ├── img4.jpeg │ │ ├── img5.jpeg │ │ ├── img6.jpeg │ │ ├── img7.jpeg │ │ ├── img8.jpeg │ │ ├── img9.jpeg │ │ ├── meishi.jpg │ │ ├── red.png │ │ ├── shuguo.jpg │ │ ├── tang.jpeg │ │ ├── tianpin.jpg │ │ ├── xiawu.jpg │ │ ├── xindian.jpg │ │ ├── yonghe.jpeg │ │ ├── youtiao.jpeg │ │ ├── zaocan.jpg │ │ └── zhunshi.jpg │ ├── js │ │ └── flexible.js │ └── scss │ │ ├── reset.scss │ │ └── style.scss ├── components │ ├── cart.vue │ ├── food_head.vue │ ├── food_menu.vue │ ├── header.vue │ ├── header1.vue │ ├── shop.vue │ └── tap.vue ├── main.js ├── router │ └── router.js ├── views │ ├── food.vue │ ├── login.vue │ ├── mall.vue │ └── portal.vue └── vuex │ ├── actions.js │ ├── index.js │ ├── mutation-types.js │ └── mutations.js ├── static ├── images │ ├── add.png │ ├── back.png │ ├── chaoshi.jpg │ ├── close.png │ ├── doujiang.jpeg │ ├── fan.jpeg │ ├── fan1.jpeg │ ├── fan2.jpeg │ ├── fan3.jpeg │ ├── fire.jpeg │ ├── food_icon1.png │ ├── food_icon2.jpeg │ ├── food_icon3.jpeg │ ├── food_icon4.png │ ├── hebaodan.jpeg │ ├── icon1.png │ ├── img1.jpeg │ ├── img10.jpeg │ ├── img2.jpeg │ ├── img3.jpeg │ ├── img4.jpeg │ ├── img5.jpeg │ ├── img6.jpeg │ ├── img7.jpeg │ ├── img8.jpeg │ ├── img9.jpeg │ ├── meishi.jpg │ ├── red.png │ ├── shuguo.jpg │ ├── star_off.png │ ├── star_on.png │ ├── tang.jpeg │ ├── tianpin.jpg │ ├── xiawu.jpg │ ├── xindian.jpg │ ├── yonghe.jpeg │ ├── youtiao.jpeg │ ├── zaocan.jpg │ └── zhunshi.jpg └── json │ ├── food.json │ ├── header1.json │ ├── nav.json │ └── rate.json └── test └── e2e ├── custom-assertions └── elementCount.js ├── nightwatch.conf.js ├── runner.js └── specs └── test.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue(DEMO,未更新状态) 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # run e2e tests 18 | npm run e2e 19 | 20 | # run all tests 21 | npm test 22 | ``` 23 | 24 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 25 | -------------------------------------------------------------------------------- /vue1.0/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/.DS_Store -------------------------------------------------------------------------------- /vue1.0/README.md: -------------------------------------------------------------------------------- 1 | # vue 2 | 3 |

Vue 饿了么版本1.0

4 |
 5 | 	项目有
 6 | 	1.登陆页
 7 | 	2.首页
 8 | 	3.商品页
 9 | 
10 |
11 | 	1.路由
12 | 	2.import from
13 | 	3.资源静态
14 | 	4.mint-ui
15 | 
-------------------------------------------------------------------------------- /vue1.0/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /vue1.0/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vue1.0/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /vue1.0/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 4 | var path = require('path') 5 | var express = require('express') 6 | var webpack = require('webpack') 7 | var opn = require('opn') 8 | var proxyMiddleware = require('http-proxy-middleware') 9 | var webpackConfig = process.env.NODE_ENV === 'testing' 10 | ? require('./webpack.prod.conf') 11 | : require('./webpack.dev.conf') 12 | 13 | // default port where dev server listens for incoming traffic 14 | var port = process.env.PORT || config.dev.port 15 | // Define HTTP proxies to your custom API backend 16 | // https://github.com/chimurai/http-proxy-middleware 17 | var proxyTable = config.dev.proxyTable 18 | 19 | var app = express() 20 | var compiler = webpack(webpackConfig) 21 | 22 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 23 | publicPath: webpackConfig.output.publicPath, 24 | stats: { 25 | colors: true, 26 | chunks: false 27 | } 28 | }) 29 | 30 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 31 | // force page reload when html-webpack-plugin template changes 32 | compiler.plugin('compilation', function (compilation) { 33 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 34 | hotMiddleware.publish({ action: 'reload' }) 35 | cb() 36 | }) 37 | }) 38 | 39 | // proxy api requests 40 | Object.keys(proxyTable).forEach(function (context) { 41 | var options = proxyTable[context] 42 | if (typeof options === 'string') { 43 | options = { target: options } 44 | } 45 | app.use(proxyMiddleware(context, options)) 46 | }) 47 | 48 | // handle fallback for HTML5 history API 49 | app.use(require('connect-history-api-fallback')()) 50 | 51 | // serve webpack bundle output 52 | app.use(devMiddleware) 53 | 54 | // enable hot-reload and state-preserving 55 | // compilation error display 56 | app.use(hotMiddleware) 57 | 58 | // serve pure static assets 59 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 60 | app.use(staticPath, express.static('./static')) 61 | 62 | module.exports = app.listen(port, function (err) { 63 | if (err) { 64 | console.log(err) 65 | return 66 | } 67 | var uri = 'http://localhost:' + port 68 | console.log('Listening at ' + uri + '\n') 69 | 70 | // when env is testing, don't need open it 71 | if (process.env.NODE_ENV !== 'testing') { 72 | opn(uri) 73 | } 74 | }) 75 | -------------------------------------------------------------------------------- /vue1.0/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /vue1.0/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | 6 | var env = process.env.NODE_ENV 7 | // check env & config/index.js to decide whether to enable CSS source maps for the 8 | // various preprocessor loaders added to vue-loader at the end of this file 9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 12 | 13 | module.exports = { 14 | entry: { 15 | app: './src/main.js' 16 | }, 17 | output: { 18 | path: config.build.assetsRoot, 19 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 20 | filename: '[name].js' 21 | }, 22 | resolve: { 23 | extensions: ['', '.js', '.vue', '.json'], 24 | fallback: [path.join(__dirname, '../node_modules')], 25 | alias: { 26 | 'vue$': 'vue/dist/vue.common.js', 27 | 'src': path.resolve(__dirname, '../src'), 28 | 'assets': path.resolve(__dirname, '../src/assets'), 29 | 'components': path.resolve(__dirname, '../src/components') 30 | } 31 | }, 32 | resolveLoader: { 33 | fallback: [path.join(__dirname, '../node_modules')] 34 | }, 35 | module: { 36 | loaders: [ 37 | { 38 | test: /\.vue$/, 39 | loader: 'vue' 40 | }, 41 | { 42 | test: /\.js$/, 43 | loader: 'babel', 44 | include: projectRoot, 45 | exclude: /node_modules/ 46 | }, 47 | { 48 | test: /\.json$/, 49 | loader: 'json' 50 | }, 51 | { 52 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 53 | loader: 'url', 54 | query: { 55 | limit: 10000, 56 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 57 | } 58 | }, 59 | { 60 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 61 | loader: 'url', 62 | query: { 63 | limit: 10000, 64 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 65 | } 66 | } 67 | ] 68 | }, 69 | vue: { 70 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 71 | postcss: [ 72 | require('autoprefixer')({ 73 | browsers: ['last 2 versions'] 74 | }) 75 | ] 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vue1.0/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurrenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /vue1.0/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue1.0/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vue1.0/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /vue1.0/config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue1.0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vue1.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "daozhang", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "e2e": "node test/e2e/runner.js", 11 | "test": "npm run e2e" 12 | }, 13 | "dependencies": { 14 | "mint-ui": "^2.0.6", 15 | "vue": "^2.1.0" 16 | }, 17 | "devDependencies": { 18 | "autoprefixer": "^6.4.0", 19 | "babel-core": "^6.0.0", 20 | "babel-loader": "^6.0.0", 21 | "babel-plugin-transform-runtime": "^6.0.0", 22 | "babel-preset-es2015": "^6.0.0", 23 | "babel-preset-stage-2": "^6.0.0", 24 | "babel-register": "^6.0.0", 25 | "chalk": "^1.1.3", 26 | "chromedriver": "^2.21.2", 27 | "connect-history-api-fallback": "^1.1.0", 28 | "cross-spawn": "^4.0.2", 29 | "css-loader": "^0.25.0", 30 | "eventsource-polyfill": "^0.9.6", 31 | "express": "^4.13.3", 32 | "extract-text-webpack-plugin": "^1.0.1", 33 | "file-loader": "^0.9.0", 34 | "function-bind": "^1.0.2", 35 | "html-webpack-plugin": "^2.8.1", 36 | "http-proxy-middleware": "^0.17.2", 37 | "json-loader": "^0.5.4", 38 | "nightwatch": "^0.9.8", 39 | "node-sass": "^4.1.1", 40 | "opn": "^4.0.2", 41 | "ora": "^0.3.0", 42 | "sass-loader": "^4.1.1", 43 | "selenium-server": "2.53.1", 44 | "semver": "^5.3.0", 45 | "shelljs": "^0.7.4", 46 | "url-loader": "^0.5.7", 47 | "vue-loader": "^10.0.0", 48 | "vue-style-loader": "^1.0.0", 49 | "vue-template-compiler": "^2.1.0", 50 | "webpack": "^1.13.2", 51 | "webpack-dev-middleware": "^1.8.3", 52 | "webpack-hot-middleware": "^2.12.2", 53 | "webpack-merge": "^0.14.1" 54 | }, 55 | "engines": { 56 | "node": ">= 4.0.0", 57 | "npm": ">= 3.0.0" 58 | } 59 | } -------------------------------------------------------------------------------- /vue1.0/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/.DS_Store -------------------------------------------------------------------------------- /vue1.0/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 17 | -------------------------------------------------------------------------------- /vue1.0/src/assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/.DS_Store -------------------------------------------------------------------------------- /vue1.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc -------------------------------------------------------------------------------- /vue1.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc -------------------------------------------------------------------------------- /vue1.0/src/assets/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/.DS_Store -------------------------------------------------------------------------------- /vue1.0/src/assets/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/close.png -------------------------------------------------------------------------------- /vue1.0/src/assets/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/food_icon1.png -------------------------------------------------------------------------------- /vue1.0/src/assets/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/food_icon4.png -------------------------------------------------------------------------------- /vue1.0/src/assets/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/icon1.png -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img1.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img10.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img2.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img3.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img4.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img5.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img6.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img7.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img8.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/img9.jpeg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/meishi.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/shuguo.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/tianpin.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/xiawu.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/xindian.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/zaocan.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue1.0/src/assets/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/js/.DS_Store -------------------------------------------------------------------------------- /vue1.0/src/assets/scss/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/assets/scss/.DS_Store -------------------------------------------------------------------------------- /vue1.0/src/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/src/components/.DS_Store -------------------------------------------------------------------------------- /vue1.0/src/components/header.vue: -------------------------------------------------------------------------------- 1 | 8 | 16 | 69 | -------------------------------------------------------------------------------- /vue1.0/src/json/form.js: -------------------------------------------------------------------------------- 1 | export default [{ 2 | 'id': 17, 3 | 'pass_count': 44 4 | }, { 5 | 'id': 18, 6 | 'pass_count': 45 7 | }, { 8 | 'id': 19, 9 | 'pass_count': 23 10 | }, { 11 | 'id': 20, 12 | 'pass_count': 35 13 | }, { 14 | 'id': 21, 15 | 'pass_count': 52 16 | }, { 17 | 'id': 22, 18 | 'pass_count': 39 19 | }, { 20 | 'id': 23, 21 | 'pass_count': 54 22 | }, { 23 | 'id': 24, 24 | 'pass_count': 36 25 | }, { 26 | 'id': 25, 27 | 'pass_count': 26 28 | }] 29 | -------------------------------------------------------------------------------- /vue1.0/src/json/nav.js: -------------------------------------------------------------------------------- 1 | export default [{ 2 | 'name': '美食', 3 | 'href': '#food', 4 | 'img': 'meishi.jpg' 5 | }, { 6 | 'name': '甜品饮品', 7 | 'href': '#food', 8 | 'img': 'tianpin.jpg' 9 | }, { 10 | 'name': '商店超市', 11 | 'href': '#food', 12 | 'img': 'chaoshi.jpg' 13 | }, { 14 | 'name': '预定早餐', 15 | 'href': '#food', 16 | 'img': 'zaocan.jpg' 17 | }, { 18 | 'name': '果蔬生疏', 19 | 'href': '#food', 20 | 'img': 'shuguo.jpg' 21 | }, { 22 | 'name': '新店特惠', 23 | 'href': '#food', 24 | 'img': 'xindian.jpg' 25 | }, { 26 | 'name': '准时达', 27 | 'href': '#food', 28 | 'img': 'zhunshi.jpg' 29 | }, { 30 | 'name': '下午茶', 31 | 'href': '#food', 32 | 'img': 'xiawu.jpg' 33 | }] 34 | -------------------------------------------------------------------------------- /vue1.0/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import VueResource from 'vue-resource' 6 | import VueRouter from './router/router.js' 7 | import Mint from 'mint-ui' 8 | import reset from './assets/css/reset.css' 9 | import style from './assets/css/style.css' 10 | import mintUI from 'mint-ui/lib/style.css' 11 | import flexible from './assets/js/flexible.js' 12 | 13 | Vue.use(Mint); 14 | Vue.use(VueResource); 15 | 16 | 17 | new Vue({ 18 | el: "#app", 19 | router: VueRouter, 20 | render: h => h(App) 21 | }) 22 | -------------------------------------------------------------------------------- /vue1.0/src/router/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | Vue.use(VueRouter) 4 | import portal from '../views/portal.vue' 5 | import food from '../views/food.vue' 6 | import login from '../views/login.vue' 7 | 8 | const router = new VueRouter({ 9 | routes: [{ 10 | path: '/login', 11 | component: login 12 | }, { 13 | path: '/portal', 14 | component: portal 15 | }, { 16 | path: '/food', 17 | component: food 18 | }, { 19 | path: '*', 20 | redirect: '/login' 21 | }] 22 | }) 23 | export default router; 24 | -------------------------------------------------------------------------------- /vue1.0/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 18 | 47 | -------------------------------------------------------------------------------- /vue1.0/static/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/.DS_Store -------------------------------------------------------------------------------- /vue1.0/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/.gitkeep -------------------------------------------------------------------------------- /vue1.0/static/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/.DS_Store -------------------------------------------------------------------------------- /vue1.0/static/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/close.png -------------------------------------------------------------------------------- /vue1.0/static/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/food_icon1.png -------------------------------------------------------------------------------- /vue1.0/static/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/food_icon4.png -------------------------------------------------------------------------------- /vue1.0/static/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/icon1.png -------------------------------------------------------------------------------- /vue1.0/static/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img1.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img10.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img2.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img3.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img4.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img5.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img6.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img7.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img8.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/img9.jpeg -------------------------------------------------------------------------------- /vue1.0/static/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/meishi.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/shuguo.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/tianpin.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/xiawu.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/xindian.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/zaocan.jpg -------------------------------------------------------------------------------- /vue1.0/static/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.0/static/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue1.0/test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // the name of the method is the filename. 3 | // can be used in tests like this: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // for how to write custom assertions see 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | exports.assertion = function (selector, count) { 10 | this.message = 'Testing if element <' + selector + '> has count: ' + count 11 | this.expected = count 12 | this.pass = function (val) { 13 | return val === this.expected 14 | } 15 | this.value = function (res) { 16 | return res.value 17 | } 18 | this.command = function (cb) { 19 | var self = this 20 | return this.api.execute(function (selector) { 21 | return document.querySelectorAll(selector).length 22 | }, [selector], function (res) { 23 | cb.call(self, res) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue1.0/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/guide#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar', 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vue1.0/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | var server = require('../../build/dev-server.js') 4 | 5 | // 2. run the nightwatch test suite against it 6 | // to run in additional browsers: 7 | // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" 8 | // 2. add it to the --env flag below 9 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 10 | // For more information on Nightwatch's config file, see 11 | // http://nightwatchjs.org/guide#settings-file 12 | var opts = process.argv.slice(2) 13 | if (opts.indexOf('--config') === -1) { 14 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 15 | } 16 | if (opts.indexOf('--env') === -1) { 17 | opts = opts.concat(['--env', 'chrome']) 18 | } 19 | 20 | var spawn = require('cross-spawn') 21 | var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 22 | 23 | runner.on('exit', function (code) { 24 | server.close() 25 | process.exit(code) 26 | }) 27 | 28 | runner.on('error', function (err) { 29 | server.close() 30 | throw err 31 | }) 32 | -------------------------------------------------------------------------------- /vue1.0/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vue1.4/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /vue1.4/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /vue1.4/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | test/e2e/reports 6 | selenium-debug.log 7 | -------------------------------------------------------------------------------- /vue1.4/README.md: -------------------------------------------------------------------------------- 1 | # vue 2 | 3 |

Vue 饿了么版本1.4

4 | 5 | 项目有 6 | 1.登陆页 7 | 2.首页 8 | 2.首页 内容和nav组件开发 9 | 3.商品页 10 | 3.商品重新开发并开发组件 11 | 4.购物车组件 12 | 5.商店页面并开发组件(头部,商店内容) 13 | 14 | 15 | 组件开发 16 | 1.路由 17 | 2.import from 18 | 2.Vuex 19 | 3.资源静态 20 | 3.axios 21 | 4.mint-ui 22 | 23 | 24 | -------------------------------------------------------------------------------- /vue1.4/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /vue1.4/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vue1.4/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /vue1.4/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 4 | var path = require('path') 5 | var express = require('express') 6 | var webpack = require('webpack') 7 | var opn = require('opn') 8 | var proxyMiddleware = require('http-proxy-middleware') 9 | var webpackConfig = process.env.NODE_ENV === 'testing' 10 | ? require('./webpack.prod.conf') 11 | : require('./webpack.dev.conf') 12 | 13 | // default port where dev server listens for incoming traffic 14 | var port = process.env.PORT || config.dev.port 15 | // Define HTTP proxies to your custom API backend 16 | // https://github.com/chimurai/http-proxy-middleware 17 | var proxyTable = config.dev.proxyTable 18 | 19 | var app = express() 20 | var compiler = webpack(webpackConfig) 21 | 22 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 23 | publicPath: webpackConfig.output.publicPath, 24 | stats: { 25 | colors: true, 26 | chunks: false 27 | } 28 | }) 29 | 30 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 31 | // force page reload when html-webpack-plugin template changes 32 | compiler.plugin('compilation', function (compilation) { 33 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 34 | hotMiddleware.publish({ action: 'reload' }) 35 | cb() 36 | }) 37 | }) 38 | 39 | // proxy api requests 40 | Object.keys(proxyTable).forEach(function (context) { 41 | var options = proxyTable[context] 42 | if (typeof options === 'string') { 43 | options = { target: options } 44 | } 45 | app.use(proxyMiddleware(context, options)) 46 | }) 47 | 48 | // handle fallback for HTML5 history API 49 | app.use(require('connect-history-api-fallback')()) 50 | 51 | // serve webpack bundle output 52 | app.use(devMiddleware) 53 | 54 | // enable hot-reload and state-preserving 55 | // compilation error display 56 | app.use(hotMiddleware) 57 | 58 | // serve pure static assets 59 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 60 | app.use(staticPath, express.static('./static')) 61 | 62 | module.exports = app.listen(port, function (err) { 63 | if (err) { 64 | console.log(err) 65 | return 66 | } 67 | var uri = 'http://localhost:' + port 68 | console.log('Listening at ' + uri + '\n') 69 | 70 | // when env is testing, don't need open it 71 | if (process.env.NODE_ENV !== 'testing') { 72 | opn(uri) 73 | } 74 | }) 75 | -------------------------------------------------------------------------------- /vue1.4/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /vue1.4/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | 6 | var env = process.env.NODE_ENV 7 | // check env & config/index.js to decide whether to enable CSS source maps for the 8 | // various preprocessor loaders added to vue-loader at the end of this file 9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 12 | 13 | module.exports = { 14 | entry: { 15 | app: './src/main.js' 16 | }, 17 | output: { 18 | path: config.build.assetsRoot, 19 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 20 | filename: '[name].js' 21 | }, 22 | resolve: { 23 | extensions: ['', '.js', '.vue', '.json'], 24 | fallback: [path.join(__dirname, '../node_modules')], 25 | alias: { 26 | 'vue$': 'vue/dist/vue.common.js', 27 | 'src': path.resolve(__dirname, '../src'), 28 | 'assets': path.resolve(__dirname, '../src/assets'), 29 | 'components': path.resolve(__dirname, '../src/components') 30 | } 31 | }, 32 | resolveLoader: { 33 | fallback: [path.join(__dirname, '../node_modules')] 34 | }, 35 | module: { 36 | loaders: [ 37 | { 38 | test: /\.vue$/, 39 | loader: 'vue' 40 | }, 41 | { 42 | test: /\.js$/, 43 | loader: 'babel', 44 | include: projectRoot, 45 | exclude: /node_modules/ 46 | }, 47 | { 48 | test: /\.json$/, 49 | loader: 'json' 50 | }, 51 | { 52 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 53 | loader: 'url', 54 | query: { 55 | limit: 10000, 56 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 57 | } 58 | }, 59 | { 60 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 61 | loader: 'url', 62 | query: { 63 | limit: 10000, 64 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 65 | } 66 | } 67 | ] 68 | }, 69 | vue: { 70 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 71 | postcss: [ 72 | require('autoprefixer')({ 73 | browsers: ['last 2 versions'] 74 | }) 75 | ] 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vue1.4/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurrenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /vue1.4/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue1.4/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vue1.4/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /vue1.4/config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue1.4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /vue1.4/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "daozhang", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "e2e": "node test/e2e/runner.js", 11 | "test": "npm run e2e" 12 | }, 13 | "dependencies": { 14 | "mint-ui": "^2.0.6", 15 | "vue": "^2.1.0" 16 | }, 17 | "devDependencies": { 18 | "autoprefixer": "^6.4.0", 19 | "babel-core": "^6.0.0", 20 | "babel-loader": "^6.0.0", 21 | "babel-plugin-transform-runtime": "^6.0.0", 22 | "babel-preset-es2015": "^6.0.0", 23 | "babel-preset-stage-2": "^6.0.0", 24 | "babel-register": "^6.0.0", 25 | "chalk": "^1.1.3", 26 | "chromedriver": "^2.21.2", 27 | "connect-history-api-fallback": "^1.1.0", 28 | "cross-spawn": "^4.0.2", 29 | "css-loader": "^0.25.0", 30 | "eventsource-polyfill": "^0.9.6", 31 | "express": "^4.13.3", 32 | "extract-text-webpack-plugin": "^1.0.1", 33 | "file-loader": "^0.9.0", 34 | "function-bind": "^1.0.2", 35 | "html-webpack-plugin": "^2.8.1", 36 | "http-proxy-middleware": "^0.17.2", 37 | "json-loader": "^0.5.4", 38 | "nightwatch": "^0.9.8", 39 | "node-sass": "^4.1.1", 40 | "opn": "^4.0.2", 41 | "ora": "^0.3.0", 42 | "sass-loader": "^4.1.1", 43 | "selenium-server": "2.53.1", 44 | "semver": "^5.3.0", 45 | "shelljs": "^0.7.4", 46 | "url-loader": "^0.5.7", 47 | "vue-loader": "^10.0.0", 48 | "vue-style-loader": "^1.0.0", 49 | "vue-template-compiler": "^2.1.0", 50 | "webpack": "^1.13.2", 51 | "webpack-dev-middleware": "^1.8.3", 52 | "webpack-hot-middleware": "^2.12.2", 53 | "webpack-merge": "^0.14.1" 54 | }, 55 | "engines": { 56 | "node": ">= 4.0.0", 57 | "npm": ">= 3.0.0" 58 | } 59 | } -------------------------------------------------------------------------------- /vue1.4/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 21 | -------------------------------------------------------------------------------- /vue1.4/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/reset.scssc -------------------------------------------------------------------------------- /vue1.4/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/style.scssc -------------------------------------------------------------------------------- /vue1.4/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc -------------------------------------------------------------------------------- /vue1.4/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc -------------------------------------------------------------------------------- /vue1.4/src/assets/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/add.png -------------------------------------------------------------------------------- /vue1.4/src/assets/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/close.png -------------------------------------------------------------------------------- /vue1.4/src/assets/images/doujiang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/doujiang.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/fan1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/fan1.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/fan2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/fan2.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/fan3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/fan3.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/fire.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/fire.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/food_icon1.png -------------------------------------------------------------------------------- /vue1.4/src/assets/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/food_icon4.png -------------------------------------------------------------------------------- /vue1.4/src/assets/images/hebaodan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/hebaodan.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/icon1.png -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img1.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img10.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img2.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img3.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img4.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img5.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img6.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img7.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img8.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/img9.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/meishi.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/red.png -------------------------------------------------------------------------------- /vue1.4/src/assets/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/shuguo.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/tang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/tang.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/tianpin.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/xiawu.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/xindian.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/yonghe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/yonghe.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/youtiao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/youtiao.jpeg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/zaocan.jpg -------------------------------------------------------------------------------- /vue1.4/src/assets/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/src/assets/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue1.4/src/components/cart.vue: -------------------------------------------------------------------------------- 1 | 12 | 32 | -------------------------------------------------------------------------------- /vue1.4/src/components/food_head.vue: -------------------------------------------------------------------------------- 1 | 36 | 89 | -------------------------------------------------------------------------------- /vue1.4/src/components/header.vue: -------------------------------------------------------------------------------- 1 | 10 | 18 | 26 | -------------------------------------------------------------------------------- /vue1.4/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import Mint from 'mint-ui' 6 | import axios from 'axios' 7 | import Vueaxios from 'vue-axios' 8 | 9 | import store from './vuex/index.js' 10 | import VueRouter from './router/router.js' 11 | import flexible from './assets/js/flexible.js' 12 | 13 | import reset from './assets/css/reset.css' 14 | import style from './assets/css/style.css' 15 | import mintUI from 'mint-ui/lib/style.css' 16 | 17 | Vue.use(Mint); 18 | Vue.use(Vueaxios, axios); 19 | 20 | new Vue({ 21 | el: "#app", 22 | store: store, 23 | router: VueRouter, 24 | render: h => h(App) 25 | }); 26 | -------------------------------------------------------------------------------- /vue1.4/src/router/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | Vue.use(VueRouter); 4 | import login from '../views/login.vue' 5 | import portal from '../views/portal.vue' 6 | import mall from '../views/mall.vue' 7 | import food from '../views/food.vue' 8 | 9 | const router = new VueRouter({ 10 | routes: [{ 11 | path: "/login", 12 | component: login, 13 | name: "登陆" 14 | }, { 15 | path: "/portal", 16 | component: portal, 17 | name: "首页" 18 | }, { 19 | path: "/mall", 20 | component: mall, 21 | name: "美食" 22 | }, { 23 | path: "/food", 24 | component: food 25 | }, { 26 | path: "*", 27 | redirect: "/login" 28 | }] 29 | }) 30 | 31 | export default router; 32 | -------------------------------------------------------------------------------- /vue1.4/src/views/food.vue: -------------------------------------------------------------------------------- 1 | 8 | 24 | -------------------------------------------------------------------------------- /vue1.4/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 22 | 47 | -------------------------------------------------------------------------------- /vue1.4/src/views/mall.vue: -------------------------------------------------------------------------------- 1 | 7 | 22 | -------------------------------------------------------------------------------- /vue1.4/src/views/portal.vue: -------------------------------------------------------------------------------- 1 | 31 | 60 | -------------------------------------------------------------------------------- /vue1.4/src/vuex/actions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | 5 | import * as types from './mutation-types' 6 | 7 | export default { 8 | changeHead({commit}, head) { 9 | commit(types.head, head) 10 | }, 11 | changeShop({commit}, shop) { 12 | commit(types.SHOP, shop) 13 | }, 14 | changeFood({commit}, food) { 15 | commit(types.FOOD, food) 16 | }, 17 | changeFoodNav({commit},foodnav){ 18 | commit(types.FOODNAV,foodnav) 19 | }, 20 | //分类总计 21 | typeCodeAdd({commit},typecode){ 22 | commit(types.TYPECODEADD,typecode) 23 | }, 24 | typeCodeMin({commit},typecode){ 25 | commit(types.TYPECODEMIN,typecode) 26 | }, 27 | //分类数组 28 | typeList({commit},typelist){ 29 | commit(types.TYPELIST,typelist) 30 | }, 31 | boughtList({commit},boughtList){ 32 | commit(types.BOUGHTLIST,boughtList) 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /vue1.4/src/vuex/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2016/12/7. 3 | */ 4 | // src/store/index.js 完整代码 5 | 6 | import Vue from 'vue' 7 | import Vuex from 'vuex' 8 | import mutations from './mutations.js' 9 | import actions from './actions.js' 10 | Vue.use(Vuex); 11 | 12 | const state = { 13 | head: document.location.hash.substring(2), 14 | shop: [], //店铺 15 | food: [], //食物 16 | foodnav: 0, //商品||商店 17 | typeCode: '', //分类计数 18 | boughtList: { 19 | bought: 0, 20 | num: 0, 21 | list: [] 22 | } 23 | }; 24 | 25 | export default new Vuex.Store({ 26 | state, 27 | mutations, 28 | actions 29 | }); 30 | // this.$store.state.xx 获取参数 31 | // this.$store.dispatch('action名', 传值); 32 | -------------------------------------------------------------------------------- /vue1.4/src/vuex/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | 5 | export const Head = 'Head'; 6 | export const SHOP = 'SHOP'; 7 | export const FOOD = 'FOOD'; 8 | export const FOODNAV = 'FOODNAV'; 9 | export const TYPECODE = 'TYPECODE'; 10 | export const TYPECODEADD = 'TYPECODEADD'; 11 | export const TYPECODEMIN = 'TYPECODEMIN'; 12 | export const BOUGHTLIST = 'BOUGHTLIST'; 13 | -------------------------------------------------------------------------------- /vue1.4/src/vuex/mutations.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | import * as types from './mutation-types' 5 | import Vue from 'vue' 6 | 7 | export default { 8 | [types.HEAD](state, head) { 9 | state.head = head; 10 | }, 11 | // 商店 12 | [types.SHOP](state, shop) { 13 | state.shop = shop; 14 | }, 15 | // 食物 16 | [types.FOOD](state, food) { 17 | state.food = food; 18 | }, 19 | //商品||商家 20 | [types.FOODNAV](state, foodnav) { 21 | state.foodnav = foodnav; 22 | }, 23 | //类型 24 | [types.TYPECODEADD](state, goodsid) { 25 | for (let i = 0, len = state.food[0].menu_nav.length; i < len; i++) { 26 | if (state.food[0].menu_nav[i].goodsid === goodsid) { 27 | state.food[0].menu_nav[i].num++; 28 | break; 29 | }; 30 | }; 31 | }, 32 | [types.TYPECODEMIN](state, goodsid) { 33 | for (let i = 0, len = state.food[0].menu_nav.length; i < len; i++) { 34 | if (state.food[0].menu_nav[i].goodsid === goodsid) { 35 | if (state.food[0].menu_nav[i].num < 0) { 36 | state.food[0].menu_nav[i].num = 0; 37 | } else { 38 | state.food[0].menu_nav[i].num--; 39 | }; 40 | break; 41 | }; 42 | }; 43 | }, 44 | [types.TYPELIST](state, typelist) { 45 | state.typelist = typelist; 46 | }, 47 | //购物 48 | [types.BOUGHTLIST](state, boughtList) { 49 | if (boughtList.bought == true) { 50 | state.boughtList.bought += Number(boughtList.money); 51 | state.boughtList.num++; 52 | } else { 53 | state.boughtList.bought -= Number(boughtList.money); 54 | state.boughtList.num--; 55 | } 56 | state.boughtList.list.push(boughtList); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /vue1.4/static/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/add.png -------------------------------------------------------------------------------- /vue1.4/static/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/close.png -------------------------------------------------------------------------------- /vue1.4/static/images/doujiang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/doujiang.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/fan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/fan.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/fan1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/fan1.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/fan2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/fan2.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/fan3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/fan3.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/fire.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/fire.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/food_icon1.png -------------------------------------------------------------------------------- /vue1.4/static/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/food_icon4.png -------------------------------------------------------------------------------- /vue1.4/static/images/hebaodan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/hebaodan.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/icon1.png -------------------------------------------------------------------------------- /vue1.4/static/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img1.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img10.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img2.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img3.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img4.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img5.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img6.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img7.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img8.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/img9.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/meishi.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/red.png -------------------------------------------------------------------------------- /vue1.4/static/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/shuguo.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/tang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/tang.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/tianpin.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/xiawu.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/xindian.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/yonghe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/yonghe.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/youtiao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/youtiao.jpeg -------------------------------------------------------------------------------- /vue1.4/static/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/zaocan.jpg -------------------------------------------------------------------------------- /vue1.4/static/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue1.4/static/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue1.4/static/json/nav.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "name": "美食", 3 | "href": "#mall", 4 | "img": "meishi.jpg" 5 | }, { 6 | "name": "甜品饮品", 7 | "href": "#mall", 8 | "img": "tianpin.jpg" 9 | }, { 10 | "name": "商店超市", 11 | "href": "#mall", 12 | "img": "chaoshi.jpg" 13 | }, { 14 | "name": "预定早餐", 15 | "href": "#mall", 16 | "img": "zaocan.jpg" 17 | }, { 18 | "name": "果蔬生疏", 19 | "href": "#mall", 20 | "img": "shuguo.jpg" 21 | }, { 22 | "name": "新店特惠", 23 | "href": "#mall", 24 | "img": "xindian.jpg" 25 | }, { 26 | "name": "准时达", 27 | "href": "#mall", 28 | "img": "zhunshi.jpg" 29 | }, { 30 | "name": "下午茶", 31 | "href": "#mall", 32 | "img": "xiawu.jpg" 33 | }] 34 | -------------------------------------------------------------------------------- /vue1.4/test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // the name of the method is the filename. 3 | // can be used in tests like this: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // for how to write custom assertions see 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | exports.assertion = function (selector, count) { 10 | this.message = 'Testing if element <' + selector + '> has count: ' + count 11 | this.expected = count 12 | this.pass = function (val) { 13 | return val === this.expected 14 | } 15 | this.value = function (res) { 16 | return res.value 17 | } 18 | this.command = function (cb) { 19 | var self = this 20 | return this.api.execute(function (selector) { 21 | return document.querySelectorAll(selector).length 22 | }, [selector], function (res) { 23 | cb.call(self, res) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue1.4/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/guide#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar', 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vue1.4/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | var server = require('../../build/dev-server.js') 4 | 5 | // 2. run the nightwatch test suite against it 6 | // to run in additional browsers: 7 | // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" 8 | // 2. add it to the --env flag below 9 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 10 | // For more information on Nightwatch's config file, see 11 | // http://nightwatchjs.org/guide#settings-file 12 | var opts = process.argv.slice(2) 13 | if (opts.indexOf('--config') === -1) { 14 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 15 | } 16 | if (opts.indexOf('--env') === -1) { 17 | opts = opts.concat(['--env', 'chrome']) 18 | } 19 | 20 | var spawn = require('cross-spawn') 21 | var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 22 | 23 | runner.on('exit', function (code) { 24 | server.close() 25 | process.exit(code) 26 | }) 27 | 28 | runner.on('error', function (err) { 29 | server.close() 30 | throw err 31 | }) 32 | -------------------------------------------------------------------------------- /vue1.4/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vue2.0/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /vue2.0/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /vue2.0/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | test/e2e/reports 6 | selenium-debug.log 7 | -------------------------------------------------------------------------------- /vue2.0/README.md: -------------------------------------------------------------------------------- 1 | # vue 2 | 3 |

Vue 饿了么版本2.0

4 | 5 | 项目有 6 | 1.登陆页 7 | 2.首页 8 | 2.首页 内容和nav组件开发 9 | 2.局部指令 拖拽效果 10 | 3.商品页 11 | 3.商品重新开发并开发组件 12 | 4.购物车组件 13 | 5.商店页面并开发组件(头部,商店内容) 14 | 6.标题组件开发 15 | 16 | 17 | 18 | 组件开发 19 | 1.路由 20 | 2.import from 21 | 2.Vuex 22 | 3.资源静态 23 | 3.axios 24 | 4.mint-ui 25 | 5.局部指令开发 26 | -------------------------------------------------------------------------------- /vue2.0/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /vue2.0/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vue2.0/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /vue2.0/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 4 | var path = require('path') 5 | var express = require('express') 6 | var webpack = require('webpack') 7 | var opn = require('opn') 8 | var proxyMiddleware = require('http-proxy-middleware') 9 | var webpackConfig = process.env.NODE_ENV === 'testing' 10 | ? require('./webpack.prod.conf') 11 | : require('./webpack.dev.conf') 12 | 13 | // default port where dev server listens for incoming traffic 14 | var port = process.env.PORT || config.dev.port 15 | // Define HTTP proxies to your custom API backend 16 | // https://github.com/chimurai/http-proxy-middleware 17 | var proxyTable = config.dev.proxyTable 18 | 19 | var app = express() 20 | var compiler = webpack(webpackConfig) 21 | 22 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 23 | publicPath: webpackConfig.output.publicPath, 24 | stats: { 25 | colors: true, 26 | chunks: false 27 | } 28 | }) 29 | 30 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 31 | // force page reload when html-webpack-plugin template changes 32 | compiler.plugin('compilation', function (compilation) { 33 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 34 | hotMiddleware.publish({ action: 'reload' }) 35 | cb() 36 | }) 37 | }) 38 | 39 | // proxy api requests 40 | Object.keys(proxyTable).forEach(function (context) { 41 | var options = proxyTable[context] 42 | if (typeof options === 'string') { 43 | options = { target: options } 44 | } 45 | app.use(proxyMiddleware(context, options)) 46 | }) 47 | 48 | // handle fallback for HTML5 history API 49 | app.use(require('connect-history-api-fallback')()) 50 | 51 | // serve webpack bundle output 52 | app.use(devMiddleware) 53 | 54 | // enable hot-reload and state-preserving 55 | // compilation error display 56 | app.use(hotMiddleware) 57 | 58 | // serve pure static assets 59 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 60 | app.use(staticPath, express.static('./static')) 61 | 62 | module.exports = app.listen(port, function (err) { 63 | if (err) { 64 | console.log(err) 65 | return 66 | } 67 | var uri = 'http://localhost:' + port 68 | console.log('Listening at ' + uri + '\n') 69 | 70 | // when env is testing, don't need open it 71 | if (process.env.NODE_ENV !== 'testing') { 72 | opn(uri) 73 | } 74 | }) 75 | -------------------------------------------------------------------------------- /vue2.0/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /vue2.0/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | 6 | var env = process.env.NODE_ENV 7 | // check env & config/index.js to decide whether to enable CSS source maps for the 8 | // various preprocessor loaders added to vue-loader at the end of this file 9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 12 | 13 | module.exports = { 14 | entry: { 15 | app: './src/main.js' 16 | }, 17 | output: { 18 | path: config.build.assetsRoot, 19 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 20 | filename: '[name].js' 21 | }, 22 | resolve: { 23 | extensions: ['', '.js', '.vue', '.json'], 24 | fallback: [path.join(__dirname, '../node_modules')], 25 | alias: { 26 | 'vue$': 'vue/dist/vue.common.js', 27 | 'src': path.resolve(__dirname, '../src'), 28 | 'assets': path.resolve(__dirname, '../src/assets'), 29 | 'components': path.resolve(__dirname, '../src/components') 30 | } 31 | }, 32 | resolveLoader: { 33 | fallback: [path.join(__dirname, '../node_modules')] 34 | }, 35 | module: { 36 | loaders: [ 37 | { 38 | test: /\.vue$/, 39 | loader: 'vue' 40 | }, 41 | { 42 | test: /\.js$/, 43 | loader: 'babel', 44 | include: projectRoot, 45 | exclude: /node_modules/ 46 | }, 47 | { 48 | test: /\.json$/, 49 | loader: 'json' 50 | }, 51 | { 52 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 53 | loader: 'url', 54 | query: { 55 | limit: 10000, 56 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 57 | } 58 | }, 59 | { 60 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 61 | loader: 'url', 62 | query: { 63 | limit: 10000, 64 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 65 | } 66 | } 67 | ] 68 | }, 69 | vue: { 70 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 71 | postcss: [ 72 | require('autoprefixer')({ 73 | browsers: ['last 2 versions'] 74 | }) 75 | ] 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vue2.0/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurrenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /vue2.0/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue2.0/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vue2.0/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /vue2.0/config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue2.0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue 7 | 8 | 9 | 10 |
11 | 12 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vue2.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "daozhang", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "e2e": "node test/e2e/runner.js", 11 | "test": "npm run e2e" 12 | }, 13 | "dependencies": { 14 | "mint-ui": "^2.0.6", 15 | "vue": "^2.1.0" 16 | }, 17 | "devDependencies": { 18 | "autoprefixer": "^6.4.0", 19 | "babel-core": "^6.0.0", 20 | "babel-loader": "^6.0.0", 21 | "babel-plugin-transform-runtime": "^6.0.0", 22 | "babel-preset-es2015": "^6.0.0", 23 | "babel-preset-stage-2": "^6.0.0", 24 | "babel-register": "^6.0.0", 25 | "chalk": "^1.1.3", 26 | "chromedriver": "^2.21.2", 27 | "connect-history-api-fallback": "^1.1.0", 28 | "cross-spawn": "^4.0.2", 29 | "css-loader": "^0.25.0", 30 | "eventsource-polyfill": "^0.9.6", 31 | "express": "^4.13.3", 32 | "extract-text-webpack-plugin": "^1.0.1", 33 | "file-loader": "^0.9.0", 34 | "function-bind": "^1.0.2", 35 | "html-webpack-plugin": "^2.8.1", 36 | "http-proxy-middleware": "^0.17.2", 37 | "json-loader": "^0.5.4", 38 | "nightwatch": "^0.9.8", 39 | "node-sass": "^4.1.1", 40 | "opn": "^4.0.2", 41 | "ora": "^0.3.0", 42 | "sass-loader": "^4.1.1", 43 | "selenium-server": "2.53.1", 44 | "semver": "^5.3.0", 45 | "shelljs": "^0.7.4", 46 | "url-loader": "^0.5.7", 47 | "vue-loader": "^10.0.0", 48 | "vue-style-loader": "^1.0.0", 49 | "vue-template-compiler": "^2.1.0", 50 | "webpack": "^1.13.2", 51 | "webpack-dev-middleware": "^1.8.3", 52 | "webpack-hot-middleware": "^2.12.2", 53 | "webpack-merge": "^0.14.1" 54 | }, 55 | "engines": { 56 | "node": ">= 4.0.0", 57 | "npm": ">= 3.0.0" 58 | } 59 | } -------------------------------------------------------------------------------- /vue2.0/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 21 | -------------------------------------------------------------------------------- /vue2.0/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/reset.scssc -------------------------------------------------------------------------------- /vue2.0/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/style.scssc -------------------------------------------------------------------------------- /vue2.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc -------------------------------------------------------------------------------- /vue2.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc -------------------------------------------------------------------------------- /vue2.0/src/assets/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/add.png -------------------------------------------------------------------------------- /vue2.0/src/assets/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/close.png -------------------------------------------------------------------------------- /vue2.0/src/assets/images/doujiang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/doujiang.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/fan1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/fan1.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/fan2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/fan2.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/fan3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/fan3.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/fire.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/fire.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/food_icon1.png -------------------------------------------------------------------------------- /vue2.0/src/assets/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/food_icon4.png -------------------------------------------------------------------------------- /vue2.0/src/assets/images/hebaodan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/hebaodan.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/icon1.png -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img1.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img10.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img2.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img3.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img4.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img5.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img6.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img7.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img8.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/img9.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/meishi.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/red.png -------------------------------------------------------------------------------- /vue2.0/src/assets/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/shuguo.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/tang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/tang.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/tianpin.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/xiawu.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/xindian.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/yonghe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/yonghe.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/youtiao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/youtiao.jpeg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/zaocan.jpg -------------------------------------------------------------------------------- /vue2.0/src/assets/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/src/assets/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue2.0/src/components/cart.vue: -------------------------------------------------------------------------------- 1 | 12 | 32 | -------------------------------------------------------------------------------- /vue2.0/src/components/food_head.vue: -------------------------------------------------------------------------------- 1 | 36 | 89 | -------------------------------------------------------------------------------- /vue2.0/src/components/header.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /vue2.0/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import Mint from 'mint-ui' 6 | import axios from 'axios' 7 | import Vueaxios from 'vue-axios' 8 | // import touch from 'vue-touch'; 9 | 10 | import store from './vuex/index.js' 11 | import VueRouter from './router/router.js' 12 | import flexible from './assets/js/flexible.js' 13 | 14 | import reset from './assets/css/reset.css' 15 | import style from './assets/css/style.css' 16 | import mintUI from 'mint-ui/lib/style.css' 17 | 18 | 19 | // Vue.use(touch); 20 | Vue.use(Mint); 21 | Vue.use(Vueaxios, axios); 22 | 23 | new Vue({ 24 | el: "#app", 25 | store: store, 26 | router: VueRouter, 27 | render: h => h(App) 28 | }); 29 | -------------------------------------------------------------------------------- /vue2.0/src/router/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | Vue.use(VueRouter); 4 | import login from '../views/login.vue' 5 | import portal from '../views/portal.vue' 6 | import mall from '../views/mall.vue' 7 | import food from '../views/food.vue' 8 | 9 | const router = new VueRouter({ 10 | routes: [{ 11 | path: "/login", 12 | component: login, 13 | name: "登录" 14 | }, { 15 | path: "/portal", 16 | component: portal, 17 | name: "首页", 18 | meta: { 19 | to: '#login' 20 | } 21 | }, { 22 | path: "/mall", 23 | component: mall, 24 | name: "美食", 25 | meta: { 26 | to: '#portal' 27 | } 28 | }, { 29 | path: "/food", 30 | component: food 31 | }, { 32 | path: "*", 33 | redirect: "/login" 34 | }] 35 | }) 36 | 37 | export default router; 38 | -------------------------------------------------------------------------------- /vue2.0/src/views/food.vue: -------------------------------------------------------------------------------- 1 | 8 | 24 | -------------------------------------------------------------------------------- /vue2.0/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 22 | 47 | -------------------------------------------------------------------------------- /vue2.0/src/views/mall.vue: -------------------------------------------------------------------------------- 1 | 7 | 22 | -------------------------------------------------------------------------------- /vue2.0/src/vuex/actions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | 5 | import * as types from './mutation-types' 6 | 7 | export default { 8 | changeHead({commit}, head) { 9 | commit(types.head, head) 10 | }, 11 | changeShop({commit}, shop) { 12 | commit(types.SHOP, shop) 13 | }, 14 | changeFood({commit}, food) { 15 | commit(types.FOOD, food) 16 | }, 17 | changeFoodNav({commit},foodnav){ 18 | commit(types.FOODNAV,foodnav) 19 | }, 20 | //分类总计 21 | typeCodeAdd({commit},typecode){ 22 | commit(types.TYPECODEADD,typecode) 23 | }, 24 | typeCodeMin({commit},typecode){ 25 | commit(types.TYPECODEMIN,typecode) 26 | }, 27 | //分类数组 28 | typeList({commit},typelist){ 29 | commit(types.TYPELIST,typelist) 30 | }, 31 | boughtList({commit},boughtList){ 32 | commit(types.BOUGHTLIST,boughtList) 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /vue2.0/src/vuex/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2016/12/7. 3 | */ 4 | // src/store/index.js 完整代码 5 | 6 | import Vue from 'vue' 7 | import Vuex from 'vuex' 8 | import mutations from './mutations.js' 9 | import actions from './actions.js' 10 | Vue.use(Vuex); 11 | 12 | const state = { 13 | head: document.location.hash.substring(2), 14 | shop: [], //店铺 15 | food: [], //食物 16 | foodnav: 0, //商品||商店 17 | typeCode: '', //分类计数 18 | boughtList: { 19 | bought: 0, 20 | num: 0, 21 | list: [] 22 | } 23 | }; 24 | 25 | export default new Vuex.Store({ 26 | state, 27 | mutations, 28 | actions 29 | }); 30 | // this.$store.state.xx 获取参数 31 | // this.$store.dispatch('action名', 传值); 32 | -------------------------------------------------------------------------------- /vue2.0/src/vuex/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | 5 | export const Head = 'Head'; 6 | export const SHOP = 'SHOP'; 7 | export const FOOD = 'FOOD'; 8 | export const FOODNAV = 'FOODNAV'; 9 | export const TYPECODE = 'TYPECODE'; 10 | export const TYPECODEADD = 'TYPECODEADD'; 11 | export const TYPECODEMIN = 'TYPECODEMIN'; 12 | export const BOUGHTLIST = 'BOUGHTLIST'; 13 | -------------------------------------------------------------------------------- /vue2.0/src/vuex/mutations.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | import * as types from './mutation-types' 5 | import Vue from 'vue' 6 | 7 | export default { 8 | [types.HEAD](state, head) { 9 | state.head = head; 10 | }, 11 | // 商店 12 | [types.SHOP](state, shop) { 13 | state.shop = shop; 14 | }, 15 | // 食物 16 | [types.FOOD](state, food) { 17 | state.food = food; 18 | }, 19 | //商品||商家 20 | [types.FOODNAV](state, foodnav) { 21 | state.foodnav = foodnav; 22 | }, 23 | //类型 24 | [types.TYPECODEADD](state, goodsid) { 25 | for (let i = 0, len = state.food[0].menu_nav.length; i < len; i++) { 26 | if (state.food[0].menu_nav[i].goodsid === goodsid) { 27 | state.food[0].menu_nav[i].num++; 28 | break; 29 | }; 30 | }; 31 | }, 32 | [types.TYPECODEMIN](state, goodsid) { 33 | for (let i = 0, len = state.food[0].menu_nav.length; i < len; i++) { 34 | if (state.food[0].menu_nav[i].goodsid === goodsid) { 35 | if (state.food[0].menu_nav[i].num < 0) { 36 | state.food[0].menu_nav[i].num = 0; 37 | } else { 38 | state.food[0].menu_nav[i].num--; 39 | }; 40 | break; 41 | }; 42 | }; 43 | }, 44 | [types.TYPELIST](state, typelist) { 45 | state.typelist = typelist; 46 | }, 47 | //购物 48 | [types.BOUGHTLIST](state, boughtList) { 49 | if (boughtList.bought == true) { 50 | state.boughtList.bought += Number(boughtList.money); 51 | state.boughtList.num++; 52 | } else { 53 | state.boughtList.bought -= Number(boughtList.money); 54 | state.boughtList.num--; 55 | } 56 | state.boughtList.list.push(boughtList); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /vue2.0/static/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/add.png -------------------------------------------------------------------------------- /vue2.0/static/images/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/back.png -------------------------------------------------------------------------------- /vue2.0/static/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/close.png -------------------------------------------------------------------------------- /vue2.0/static/images/doujiang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/doujiang.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/fan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/fan.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/fan1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/fan1.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/fan2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/fan2.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/fan3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/fan3.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/fire.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/fire.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/food_icon1.png -------------------------------------------------------------------------------- /vue2.0/static/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/food_icon4.png -------------------------------------------------------------------------------- /vue2.0/static/images/hebaodan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/hebaodan.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/icon1.png -------------------------------------------------------------------------------- /vue2.0/static/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img1.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img10.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img2.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img3.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img4.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img5.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img6.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img7.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img8.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/img9.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/meishi.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/red.png -------------------------------------------------------------------------------- /vue2.0/static/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/shuguo.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/star_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/star_off.png -------------------------------------------------------------------------------- /vue2.0/static/images/star_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/star_on.png -------------------------------------------------------------------------------- /vue2.0/static/images/tang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/tang.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/tianpin.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/xiawu.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/xindian.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/yonghe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/yonghe.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/youtiao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/youtiao.jpeg -------------------------------------------------------------------------------- /vue2.0/static/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/zaocan.jpg -------------------------------------------------------------------------------- /vue2.0/static/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.0/static/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue2.0/static/json/nav.json: -------------------------------------------------------------------------------- 1 | [ 2 | [{ 3 | "name": "美食", 4 | "href": "#mall", 5 | "img": "meishi.jpg" 6 | }, { 7 | "name": "甜品饮品", 8 | "href": "#mall", 9 | "img": "tianpin.jpg" 10 | }, { 11 | "name": "商店超市", 12 | "href": "#mall", 13 | "img": "chaoshi.jpg" 14 | }, { 15 | "name": "预定早餐", 16 | "href": "#mall", 17 | "img": "zaocan.jpg" 18 | }, { 19 | "name": "果蔬生疏", 20 | "href": "#mall", 21 | "img": "shuguo.jpg" 22 | }, { 23 | "name": "新店特惠", 24 | "href": "#mall", 25 | "img": "xindian.jpg" 26 | }, { 27 | "name": "准时达", 28 | "href": "#mall", 29 | "img": "zhunshi.jpg" 30 | }, { 31 | "name": "下午茶", 32 | "href": "#mall", 33 | "img": "xiawu.jpg" 34 | }],[{ 35 | "name": "1", 36 | "href": "#mall", 37 | "img": "meishi.jpg" 38 | }, { 39 | "name": "2", 40 | "href": "#mall", 41 | "img": "tianpin.jpg" 42 | }, { 43 | "name": "3", 44 | "href": "#mall", 45 | "img": "chaoshi.jpg" 46 | }, { 47 | "name": "4", 48 | "href": "#mall", 49 | "img": "zaocan.jpg" 50 | }, { 51 | "name": "5", 52 | "href": "#mall", 53 | "img": "shuguo.jpg" 54 | }, { 55 | "name": "6", 56 | "href": "#mall", 57 | "img": "xindian.jpg" 58 | }, { 59 | "name": "7", 60 | "href": "#mall", 61 | "img": "zhunshi.jpg" 62 | }, { 63 | "name": "8", 64 | "href": "#mall", 65 | "img": "xiawu.jpg" 66 | }] 67 | ] 68 | -------------------------------------------------------------------------------- /vue2.0/test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // the name of the method is the filename. 3 | // can be used in tests like this: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // for how to write custom assertions see 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | exports.assertion = function (selector, count) { 10 | this.message = 'Testing if element <' + selector + '> has count: ' + count 11 | this.expected = count 12 | this.pass = function (val) { 13 | return val === this.expected 14 | } 15 | this.value = function (res) { 16 | return res.value 17 | } 18 | this.command = function (cb) { 19 | var self = this 20 | return this.api.execute(function (selector) { 21 | return document.querySelectorAll(selector).length 22 | }, [selector], function (res) { 23 | cb.call(self, res) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue2.0/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/guide#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar', 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vue2.0/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | var server = require('../../build/dev-server.js') 4 | 5 | // 2. run the nightwatch test suite against it 6 | // to run in additional browsers: 7 | // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" 8 | // 2. add it to the --env flag below 9 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 10 | // For more information on Nightwatch's config file, see 11 | // http://nightwatchjs.org/guide#settings-file 12 | var opts = process.argv.slice(2) 13 | if (opts.indexOf('--config') === -1) { 14 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 15 | } 16 | if (opts.indexOf('--env') === -1) { 17 | opts = opts.concat(['--env', 'chrome']) 18 | } 19 | 20 | var spawn = require('cross-spawn') 21 | var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 22 | 23 | runner.on('exit', function (code) { 24 | server.close() 25 | process.exit(code) 26 | }) 27 | 28 | runner.on('error', function (err) { 29 | server.close() 30 | throw err 31 | }) 32 | -------------------------------------------------------------------------------- /vue2.0/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vue2.3/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /vue2.3/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /vue2.3/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | test/e2e/reports 6 | selenium-debug.log 7 | -------------------------------------------------------------------------------- /vue2.3/README.md: -------------------------------------------------------------------------------- 1 | # vue 2 | 3 |

Vue 饿了么版本2.3

4 | 5 | 项目有 6 | 1.登陆页 7 | 2.首页 8 | 2.首页 内容和nav组件开发 9 | 2.局部指令 拖拽效果 10 | 2.插件指令 拖拽效果,暂时不支持tap事件。后期维护修改。 11 | 3.商品页 12 | 3.商品重新开发并开发组件 13 | 4.购物车组件 14 | 4.更新购物车组件开发,添加购物车列表信息 15 | 5.商店页面并开发组件(头部,商店内容) 16 | 6.标题组件开发 17 | 18 | 19 | 20 | 组件开发 21 | 1.路由 22 | 2.import from 23 | 2.Vuex 24 | 3.资源静态 25 | 3.axios 26 | 4.mint-ui 27 | 5.局部指令开发 28 | -------------------------------------------------------------------------------- /vue2.3/build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('./check-versions')() 3 | require('shelljs/global') 4 | env.NODE_ENV = 'production' 5 | 6 | var path = require('path') 7 | var config = require('../config') 8 | var ora = require('ora') 9 | var webpack = require('webpack') 10 | var webpackConfig = require('./webpack.prod.conf') 11 | 12 | console.log( 13 | ' Tip:\n' + 14 | ' Built files are meant to be served over an HTTP server.\n' + 15 | ' Opening index.html over file:// won\'t work.\n' 16 | ) 17 | 18 | var spinner = ora('building for production...') 19 | spinner.start() 20 | 21 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 22 | rm('-rf', assetsPath) 23 | mkdir('-p', assetsPath) 24 | cp('-R', 'static/*', assetsPath) 25 | 26 | webpack(webpackConfig, function (err, stats) { 27 | spinner.stop() 28 | if (err) throw err 29 | process.stdout.write(stats.toString({ 30 | colors: true, 31 | modules: false, 32 | children: false, 33 | chunks: false, 34 | chunkModules: false 35 | }) + '\n') 36 | }) 37 | -------------------------------------------------------------------------------- /vue2.3/build/check-versions.js: -------------------------------------------------------------------------------- 1 | var semver = require('semver') 2 | var chalk = require('chalk') 3 | var packageConfig = require('../package.json') 4 | var exec = function (cmd) { 5 | return require('child_process') 6 | .execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | { 16 | name: 'npm', 17 | currentVersion: exec('npm --version'), 18 | versionRequirement: packageConfig.engines.npm 19 | } 20 | ] 21 | 22 | module.exports = function () { 23 | var warnings = [] 24 | for (var i = 0; i < versionRequirements.length; i++) { 25 | var mod = versionRequirements[i] 26 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 27 | warnings.push(mod.name + ': ' + 28 | chalk.red(mod.currentVersion) + ' should be ' + 29 | chalk.green(mod.versionRequirement) 30 | ) 31 | } 32 | } 33 | 34 | if (warnings.length) { 35 | console.log('') 36 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 37 | console.log() 38 | for (var i = 0; i < warnings.length; i++) { 39 | var warning = warnings[i] 40 | console.log(' ' + warning) 41 | } 42 | console.log() 43 | process.exit(1) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vue2.3/build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /vue2.3/build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | var config = require('../config') 3 | if (!process.env.NODE_ENV) process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 4 | var path = require('path') 5 | var express = require('express') 6 | var webpack = require('webpack') 7 | var opn = require('opn') 8 | var proxyMiddleware = require('http-proxy-middleware') 9 | var webpackConfig = process.env.NODE_ENV === 'testing' 10 | ? require('./webpack.prod.conf') 11 | : require('./webpack.dev.conf') 12 | 13 | // default port where dev server listens for incoming traffic 14 | var port = process.env.PORT || config.dev.port 15 | // Define HTTP proxies to your custom API backend 16 | // https://github.com/chimurai/http-proxy-middleware 17 | var proxyTable = config.dev.proxyTable 18 | 19 | var app = express() 20 | var compiler = webpack(webpackConfig) 21 | 22 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 23 | publicPath: webpackConfig.output.publicPath, 24 | stats: { 25 | colors: true, 26 | chunks: false 27 | } 28 | }) 29 | 30 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 31 | // force page reload when html-webpack-plugin template changes 32 | compiler.plugin('compilation', function (compilation) { 33 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 34 | hotMiddleware.publish({ action: 'reload' }) 35 | cb() 36 | }) 37 | }) 38 | 39 | // proxy api requests 40 | Object.keys(proxyTable).forEach(function (context) { 41 | var options = proxyTable[context] 42 | if (typeof options === 'string') { 43 | options = { target: options } 44 | } 45 | app.use(proxyMiddleware(context, options)) 46 | }) 47 | 48 | // handle fallback for HTML5 history API 49 | app.use(require('connect-history-api-fallback')()) 50 | 51 | // serve webpack bundle output 52 | app.use(devMiddleware) 53 | 54 | // enable hot-reload and state-preserving 55 | // compilation error display 56 | app.use(hotMiddleware) 57 | 58 | // serve pure static assets 59 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 60 | app.use(staticPath, express.static('./static')) 61 | 62 | module.exports = app.listen(port, function (err) { 63 | if (err) { 64 | console.log(err) 65 | return 66 | } 67 | var uri = 'http://localhost:' + port 68 | console.log('Listening at ' + uri + '\n') 69 | 70 | // when env is testing, don't need open it 71 | if (process.env.NODE_ENV !== 'testing') { 72 | opn(uri) 73 | } 74 | }) 75 | -------------------------------------------------------------------------------- /vue2.3/build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/en/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /vue2.3/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | 6 | var env = process.env.NODE_ENV 7 | // check env & config/index.js to decide whether to enable CSS source maps for the 8 | // various preprocessor loaders added to vue-loader at the end of this file 9 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 10 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 11 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 12 | 13 | module.exports = { 14 | entry: { 15 | app: './src/main.js' 16 | }, 17 | output: { 18 | path: config.build.assetsRoot, 19 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 20 | filename: '[name].js' 21 | }, 22 | resolve: { 23 | extensions: ['', '.js', '.vue', '.json'], 24 | fallback: [path.join(__dirname, '../node_modules')], 25 | alias: { 26 | 'vue$': 'vue/dist/vue.common.js', 27 | 'src': path.resolve(__dirname, '../src'), 28 | 'assets': path.resolve(__dirname, '../src/assets'), 29 | 'components': path.resolve(__dirname, '../src/components') 30 | } 31 | }, 32 | resolveLoader: { 33 | fallback: [path.join(__dirname, '../node_modules')] 34 | }, 35 | module: { 36 | loaders: [ 37 | { 38 | test: /\.vue$/, 39 | loader: 'vue' 40 | }, 41 | { 42 | test: /\.js$/, 43 | loader: 'babel', 44 | include: projectRoot, 45 | exclude: /node_modules/ 46 | }, 47 | { 48 | test: /\.json$/, 49 | loader: 'json' 50 | }, 51 | { 52 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 53 | loader: 'url', 54 | query: { 55 | limit: 10000, 56 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 57 | } 58 | }, 59 | { 60 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 61 | loader: 'url', 62 | query: { 63 | limit: 10000, 64 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 65 | } 66 | } 67 | ] 68 | }, 69 | vue: { 70 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 71 | postcss: [ 72 | require('autoprefixer')({ 73 | browsers: ['last 2 versions'] 74 | }) 75 | ] 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vue2.3/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurrenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /vue2.3/config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue2.3/config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 8080, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vue2.3/config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /vue2.3/config/test.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var devEnv = require('./dev.env') 3 | 4 | module.exports = merge(devEnv, { 5 | NODE_ENV: '"testing"' 6 | }) 7 | -------------------------------------------------------------------------------- /vue2.3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vue 7 | 8 | 9 | 10 |
11 | 12 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vue2.3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "daozhang", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "e2e": "node test/e2e/runner.js", 11 | "test": "npm run e2e" 12 | }, 13 | "dependencies": { 14 | "mint-ui": "^2.0.6", 15 | "vue": "^2.1.0", 16 | "vue-axios": "^2.1.4", 17 | "vue-router": "^3.0.2", 18 | "vuex": "^3.0.1" 19 | }, 20 | "devDependencies": { 21 | "autoprefixer": "^6.4.0", 22 | "babel-core": "^6.0.0", 23 | "babel-loader": "^6.0.0", 24 | "babel-plugin-transform-runtime": "^6.0.0", 25 | "babel-preset-es2015": "^6.0.0", 26 | "babel-preset-stage-2": "^6.0.0", 27 | "babel-register": "^6.0.0", 28 | "chalk": "^1.1.3", 29 | "chromedriver": "^2.21.2", 30 | "connect-history-api-fallback": "^1.1.0", 31 | "cross-spawn": "^4.0.2", 32 | "css-loader": "^0.25.0", 33 | "eventsource-polyfill": "^0.9.6", 34 | "express": "^4.13.3", 35 | "extract-text-webpack-plugin": "^1.0.1", 36 | "file-loader": "^0.9.0", 37 | "function-bind": "^1.0.2", 38 | "html-webpack-plugin": "^2.8.1", 39 | "http-proxy-middleware": "^0.17.2", 40 | "json-loader": "^0.5.4", 41 | "nightwatch": "^1.0.18", 42 | "node-sass": "^4.1.1", 43 | "opn": "^4.0.2", 44 | "ora": "^0.3.0", 45 | "sass-loader": "^4.1.1", 46 | "selenium-server": "2.53.1", 47 | "semver": "^5.3.0", 48 | "shelljs": "^0.7.4", 49 | "url-loader": "^1.1.2", 50 | "vue-loader": "^10.0.0", 51 | "vue-style-loader": "^1.0.0", 52 | "vue-template-compiler": "^2.1.0", 53 | "webpack": "^1.13.2", 54 | "webpack-dev-middleware": "^1.8.3", 55 | "webpack-hot-middleware": "^2.12.2", 56 | "webpack-merge": "^0.14.1" 57 | }, 58 | "engines": { 59 | "node": ">= 4.0.0", 60 | "npm": ">= 3.0.0" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vue2.3/src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 21 | -------------------------------------------------------------------------------- /vue2.3/src/assets/.sass-cache/5718f3d55d4aae51bb90a63baa87aefbb5b8b5a8/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/.sass-cache/5718f3d55d4aae51bb90a63baa87aefbb5b8b5a8/reset.scssc -------------------------------------------------------------------------------- /vue2.3/src/assets/.sass-cache/5718f3d55d4aae51bb90a63baa87aefbb5b8b5a8/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/.sass-cache/5718f3d55d4aae51bb90a63baa87aefbb5b8b5a8/style.scssc -------------------------------------------------------------------------------- /vue2.3/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/reset.scssc -------------------------------------------------------------------------------- /vue2.3/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/.sass-cache/dfd83d2e10a14fcce8d1368ac4b44a3560506b74/style.scssc -------------------------------------------------------------------------------- /vue2.3/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/reset.scssc -------------------------------------------------------------------------------- /vue2.3/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/.sass-cache/e792b3c160d449f7dd96d55f12822c161748227f/style.scssc -------------------------------------------------------------------------------- /vue2.3/src/assets/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/add.png -------------------------------------------------------------------------------- /vue2.3/src/assets/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/close.png -------------------------------------------------------------------------------- /vue2.3/src/assets/images/doujiang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/doujiang.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/fan1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/fan1.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/fan2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/fan2.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/fan3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/fan3.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/fire.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/fire.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/food_icon1.png -------------------------------------------------------------------------------- /vue2.3/src/assets/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/food_icon4.png -------------------------------------------------------------------------------- /vue2.3/src/assets/images/hebaodan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/hebaodan.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/icon1.png -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img1.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img10.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img2.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img3.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img4.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img5.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img6.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img7.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img8.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/img9.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/meishi.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/red.png -------------------------------------------------------------------------------- /vue2.3/src/assets/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/shuguo.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/tang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/tang.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/tianpin.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/xiawu.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/xindian.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/yonghe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/yonghe.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/youtiao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/youtiao.jpeg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/zaocan.jpg -------------------------------------------------------------------------------- /vue2.3/src/assets/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/src/assets/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue2.3/src/components/cart.vue: -------------------------------------------------------------------------------- 1 | 22 | 53 | -------------------------------------------------------------------------------- /vue2.3/src/components/header.vue: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /vue2.3/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import Mint from 'mint-ui' 6 | import axios from 'axios' 7 | import Vueaxios from 'vue-axios' 8 | 9 | import store from './vuex/index.js' 10 | import VueRouter from './router/router.js' 11 | import flexible from './assets/js/flexible.js' 12 | 13 | import reset from './assets/css/reset.css' 14 | import style from './assets/css/style.css' 15 | import mintUI from 'mint-ui/lib/style.css' 16 | 17 | 18 | Vue.use(Mint); 19 | Vue.use(Vueaxios, axios); 20 | 21 | new Vue({ 22 | el: "#app", 23 | store: store, 24 | router: VueRouter, 25 | render: h => h(App) 26 | }); -------------------------------------------------------------------------------- /vue2.3/src/router/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | Vue.use(VueRouter); 4 | import login from '../views/login.vue' 5 | import portal from '../views/portal.vue' 6 | import mall from '../views/mall.vue' 7 | import food from '../views/food.vue' 8 | 9 | const router = new VueRouter({ 10 | routes: [{ 11 | path: "/login", 12 | component: login, 13 | name: "登录" 14 | }, { 15 | path: "/portal", 16 | component: portal, 17 | name: "首页", 18 | meta: { 19 | to: '#login' 20 | } 21 | }, { 22 | path: "/mall", 23 | component: mall, 24 | name: "美食", 25 | meta: { 26 | to: '#portal' 27 | } 28 | }, { 29 | path: "/food", 30 | component: food 31 | }, { 32 | path: "*", 33 | redirect: "/login" 34 | }] 35 | }) 36 | 37 | export default router; 38 | -------------------------------------------------------------------------------- /vue2.3/src/views/food.vue: -------------------------------------------------------------------------------- 1 | 8 | 24 | -------------------------------------------------------------------------------- /vue2.3/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 22 | 47 | -------------------------------------------------------------------------------- /vue2.3/src/views/mall.vue: -------------------------------------------------------------------------------- 1 | 7 | 22 | -------------------------------------------------------------------------------- /vue2.3/src/vuex/actions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | 5 | import * as types from './mutation-types' 6 | 7 | export default { 8 | changeHead({commit}, head) { 9 | commit(types.head, head) 10 | }, 11 | changeShop({commit}, shop) { 12 | commit(types.SHOP, shop) 13 | }, 14 | changeFood({commit}, food) { 15 | commit(types.FOOD, food) 16 | }, 17 | changeFoodNav({commit},foodnav){ 18 | commit(types.FOODNAV,foodnav) 19 | }, 20 | //分类总计 21 | typeCodeAdd({commit},typecode){ 22 | commit(types.TYPECODEADD,typecode) 23 | }, 24 | typeCodeMin({commit},typecode){ 25 | commit(types.TYPECODEMIN,typecode) 26 | }, 27 | //分类数组 28 | typeList({commit},typelist){ 29 | commit(types.TYPELIST,typelist) 30 | }, 31 | boughtList({commit},boughtList){ 32 | commit(types.BOUGHTLIST,boughtList) 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /vue2.3/src/vuex/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2016/12/7. 3 | */ 4 | // src/store/index.js 完整代码 5 | 6 | import Vue from 'vue' 7 | import Vuex from 'vuex' 8 | import mutations from './mutations.js' 9 | import actions from './actions.js' 10 | Vue.use(Vuex); 11 | 12 | const state = { 13 | head: document.location.hash.substring(2), 14 | shop: [], //店铺 15 | food: [], //食物 16 | foodnav: 0, //商品||商店 17 | typeCode: '', //分类计数 18 | boughtList: { 19 | bought: 0, 20 | num: 0, 21 | list: [] 22 | } 23 | }; 24 | 25 | export default new Vuex.Store({ 26 | state, 27 | mutations, 28 | actions 29 | }); 30 | // this.$store.state.xx 获取参数 31 | // this.$store.dispatch('action名', 传值); 32 | -------------------------------------------------------------------------------- /vue2.3/src/vuex/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by Administrator on 2017/1/4. 3 | */ 4 | 5 | export const Head = 'Head'; 6 | export const SHOP = 'SHOP'; 7 | export const FOOD = 'FOOD'; 8 | export const FOODNAV = 'FOODNAV'; 9 | export const TYPECODE = 'TYPECODE'; 10 | export const TYPECODEADD = 'TYPECODEADD'; 11 | export const TYPECODEMIN = 'TYPECODEMIN'; 12 | export const BOUGHTLIST = 'BOUGHTLIST'; 13 | -------------------------------------------------------------------------------- /vue2.3/static/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/add.png -------------------------------------------------------------------------------- /vue2.3/static/images/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/back.png -------------------------------------------------------------------------------- /vue2.3/static/images/chaoshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/chaoshi.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/close.png -------------------------------------------------------------------------------- /vue2.3/static/images/doujiang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/doujiang.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/fan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/fan.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/fan1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/fan1.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/fan2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/fan2.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/fan3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/fan3.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/fire.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/fire.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/food_icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/food_icon1.png -------------------------------------------------------------------------------- /vue2.3/static/images/food_icon2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/food_icon2.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/food_icon3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/food_icon3.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/food_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/food_icon4.png -------------------------------------------------------------------------------- /vue2.3/static/images/hebaodan.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/hebaodan.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/icon1.png -------------------------------------------------------------------------------- /vue2.3/static/images/img1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img1.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img10.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img2.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img3.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img3.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img4.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img4.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img5.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img5.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img6.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img6.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img7.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img7.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img8.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img8.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/img9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/img9.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/meishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/meishi.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/red.png -------------------------------------------------------------------------------- /vue2.3/static/images/shuguo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/shuguo.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/star_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/star_off.png -------------------------------------------------------------------------------- /vue2.3/static/images/star_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/star_on.png -------------------------------------------------------------------------------- /vue2.3/static/images/tang.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/tang.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/tianpin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/tianpin.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/xiawu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/xiawu.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/xindian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/xindian.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/yonghe.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/yonghe.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/youtiao.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/youtiao.jpeg -------------------------------------------------------------------------------- /vue2.3/static/images/zaocan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/zaocan.jpg -------------------------------------------------------------------------------- /vue2.3/static/images/zhunshi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huaihuailjw/vue/d60db0d2fba746fbb2c45aed5b05606efecea80d/vue2.3/static/images/zhunshi.jpg -------------------------------------------------------------------------------- /vue2.3/static/json/nav.json: -------------------------------------------------------------------------------- 1 | [ 2 | [{ 3 | "name": "美食", 4 | "href": "#mall", 5 | "img": "meishi.jpg" 6 | }, { 7 | "name": "甜品饮品", 8 | "href": "#mall", 9 | "img": "tianpin.jpg" 10 | }, { 11 | "name": "商店超市", 12 | "href": "#mall", 13 | "img": "chaoshi.jpg" 14 | }, { 15 | "name": "预定早餐", 16 | "href": "#mall", 17 | "img": "zaocan.jpg" 18 | }, { 19 | "name": "果蔬生疏", 20 | "href": "#mall", 21 | "img": "shuguo.jpg" 22 | }, { 23 | "name": "新店特惠", 24 | "href": "#mall", 25 | "img": "xindian.jpg" 26 | }, { 27 | "name": "准时达", 28 | "href": "#mall", 29 | "img": "zhunshi.jpg" 30 | }, { 31 | "name": "下午茶", 32 | "href": "#mall", 33 | "img": "xiawu.jpg" 34 | }],[{ 35 | "name": "1", 36 | "href": "#mall", 37 | "img": "meishi.jpg" 38 | }, { 39 | "name": "2", 40 | "href": "#mall", 41 | "img": "tianpin.jpg" 42 | }, { 43 | "name": "3", 44 | "href": "#mall", 45 | "img": "chaoshi.jpg" 46 | }, { 47 | "name": "4", 48 | "href": "#mall", 49 | "img": "zaocan.jpg" 50 | }, { 51 | "name": "5", 52 | "href": "#mall", 53 | "img": "shuguo.jpg" 54 | }, { 55 | "name": "6", 56 | "href": "#mall", 57 | "img": "xindian.jpg" 58 | }, { 59 | "name": "7", 60 | "href": "#mall", 61 | "img": "zhunshi.jpg" 62 | }, { 63 | "name": "8", 64 | "href": "#mall", 65 | "img": "xiawu.jpg" 66 | }] 67 | ] 68 | -------------------------------------------------------------------------------- /vue2.3/test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // the name of the method is the filename. 3 | // can be used in tests like this: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // for how to write custom assertions see 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | exports.assertion = function (selector, count) { 10 | this.message = 'Testing if element <' + selector + '> has count: ' + count 11 | this.expected = count 12 | this.pass = function (val) { 13 | return val === this.expected 14 | } 15 | this.value = function (res) { 16 | return res.value 17 | } 18 | this.command = function (cb) { 19 | var self = this 20 | return this.api.execute(function (selector) { 21 | return document.querySelectorAll(selector).length 22 | }, [selector], function (res) { 23 | cb.call(self, res) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue2.3/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/guide#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar', 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vue2.3/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | var server = require('../../build/dev-server.js') 4 | 5 | // 2. run the nightwatch test suite against it 6 | // to run in additional browsers: 7 | // 1. add an entry in test/e2e/nightwatch.conf.json under "test_settings" 8 | // 2. add it to the --env flag below 9 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 10 | // For more information on Nightwatch's config file, see 11 | // http://nightwatchjs.org/guide#settings-file 12 | var opts = process.argv.slice(2) 13 | if (opts.indexOf('--config') === -1) { 14 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 15 | } 16 | if (opts.indexOf('--env') === -1) { 17 | opts = opts.concat(['--env', 'chrome']) 18 | } 19 | 20 | var spawn = require('cross-spawn') 21 | var runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 22 | 23 | runner.on('exit', function (code) { 24 | server.close() 25 | process.exit(code) 26 | }) 27 | 28 | runner.on('error', function (err) { 29 | server.close() 30 | throw err 31 | }) 32 | -------------------------------------------------------------------------------- /vue2.3/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | --------------------------------------------------------------------------------