├── vue ├── 02vue-demo │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── components │ │ │ └── HomeTable.vue │ │ └── main.js │ ├── vue.config.js │ └── yarn.lock ├── 03vue-todolist │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── components │ │ │ └── HomeTable.vue │ │ └── main.js │ ├── vue.config.js │ └── yarn.lock ├── 06cart │ ├── 01filter.html │ ├── 02计算属性.html │ ├── 03get-set.html │ ├── 04checkbox-change.html │ ├── 05foreach.html │ ├── 06every.html │ ├── 07购物车.html │ ├── 09cart-computed.html │ └── data │ │ └── carts.json ├── 07rem-router │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ ├── css │ │ │ │ └── reset.css │ │ │ └── logo.png │ │ ├── components │ │ │ └── BsBtn.vue │ │ ├── main.js │ │ ├── pages │ │ │ ├── All │ │ │ │ ├── Item.vue │ │ │ │ ├── components │ │ │ │ │ └── Item.vue │ │ │ │ └── index.vue │ │ │ ├── Music │ │ │ │ └── index.vue │ │ │ └── Mv │ │ │ │ └── index.vue │ │ └── routers │ │ │ └── index.js │ ├── utils │ │ └── config.js │ └── yarn.lock ├── 08get │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ ├── css │ │ │ │ └── reset.css │ │ │ └── logo.png │ │ ├── components │ │ │ └── BsBtn.vue │ │ ├── main.js │ │ ├── pages │ │ │ ├── All │ │ │ │ ├── components │ │ │ │ │ └── Item.vue │ │ │ │ └── index.vue │ │ │ ├── Detail │ │ │ │ └── index.vue │ │ │ ├── Music │ │ │ │ └── index.vue │ │ │ └── Mv │ │ │ │ └── index.vue │ │ ├── routers │ │ │ └── index.js │ │ └── utils │ │ │ └── config.js │ └── yarn.lock ├── 09music │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── mock │ │ └── cart.json │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ ├── logo.png │ │ │ ├── pause.png │ │ │ └── play.png │ │ ├── components │ │ │ └── Fade.vue │ │ ├── main.js │ │ ├── router │ │ │ └── index.js │ │ └── views │ │ │ ├── About.vue │ │ │ ├── Audio.vue │ │ │ └── Home.vue │ ├── vue.config.js │ └── yarn.lock ├── 10checkbox │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── main.js │ │ ├── router │ │ │ └── index.js │ │ └── views │ │ │ ├── About.vue │ │ │ └── Home.vue │ └── yarn.lock ├── 10storage │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── main.js │ │ ├── router │ │ │ └── index.js │ │ └── views │ │ │ ├── About.vue │ │ │ └── Home.vue │ └── yarn.lock ├── vue-day01 │ ├── 01hello.html │ ├── 02for-key.html │ ├── 03v-if.html │ ├── 04input.html │ ├── 05计算属性.html │ ├── 06watch.html │ ├── 07class.html │ ├── 08方法.html │ ├── 09todoList.html │ └── readme.md ├── vue-day11 │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── components │ │ │ ├── Count.vue │ │ │ ├── Dialog.vue │ │ │ ├── One.vue │ │ │ ├── Test.vue │ │ │ └── Two.vue │ │ ├── main.js │ │ ├── router │ │ │ └── index.js │ │ └── views │ │ │ ├── About.vue │ │ │ ├── Center.vue │ │ │ ├── Detail.vue │ │ │ ├── Home.vue │ │ │ └── Movie.vue │ └── yarn.lock ├── vue-day12 │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── gaode.html │ ├── map.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── main.js │ │ ├── router │ │ │ └── index.js │ │ ├── store │ │ │ └── index.js │ │ └── views │ │ │ ├── About.vue │ │ │ ├── ComingSoon.vue │ │ │ ├── Detail.vue │ │ │ ├── Films.vue │ │ │ └── NowPlaying.vue │ └── yarn.lock └── vue-day13 │ ├── .browserslistrc │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── index.html │ ├── mock │ └── cart.json │ ├── package.json │ ├── postcss.config.js │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── main.js │ ├── router │ │ └── index.js │ ├── store │ │ ├── index.js │ │ └── modules │ │ │ ├── info.js │ │ │ └── user.js │ └── views │ │ ├── About.vue │ │ ├── Home.vue │ │ └── data.js │ └── yarn.lock ├── webpack ├── artists │ ├── .gitignore │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.vue │ │ └── index.js │ └── webpack.config.js ├── cat │ ├── .gitignore │ ├── assets │ │ └── index.css │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.vue │ │ └── index.js │ └── webpack.config.js ├── newAlbum │ ├── .gitignore │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── App.vue │ │ └── index.js │ └── webpack.config.js └── radio │ ├── .gitignore │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── App.vue │ ├── components │ │ └── Item.vue │ └── index.js │ └── webpack.config.js └── web配置 ├── web-pack ├── .gitignore ├── assets │ ├── 01.png │ └── index.css ├── package-lock.json ├── package.json ├── src │ ├── App.vue │ └── index.js └── webpack.config.js └── web-yarn ├── .gitignore ├── index.js ├── package.json └── yarn.lock /vue/02vue-demo/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/02vue-demo/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/02vue-demo/README.md -------------------------------------------------------------------------------- /vue/02vue-demo/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/02vue-demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "02vue-demo", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.3.2", 12 | "element-ui": "^2.12.0", 13 | "vue": "^2.6.10" 14 | }, 15 | "devDependencies": { 16 | "@vue/cli-plugin-babel": "^4.0.0", 17 | "@vue/cli-plugin-eslint": "^4.0.0", 18 | "@vue/cli-service": "^4.0.0", 19 | "babel-eslint": "^10.0.3", 20 | "eslint": "^5.16.0", 21 | "eslint-plugin-vue": "^5.0.0", 22 | "vue-template-compiler": "^2.6.10" 23 | }, 24 | "eslintConfig": { 25 | "root": true, 26 | "env": { 27 | "node": true 28 | }, 29 | "extends": [ 30 | "plugin:vue/essential", 31 | "eslint:recommended" 32 | ], 33 | "rules": {}, 34 | "parserOptions": { 35 | "parser": "babel-eslint" 36 | } 37 | }, 38 | "postcss": { 39 | "plugins": { 40 | "autoprefixer": {} 41 | } 42 | }, 43 | "browserslist": [ 44 | "> 1%", 45 | "last 2 versions" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /vue/02vue-demo/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/02vue-demo/public/favicon.ico -------------------------------------------------------------------------------- /vue/02vue-demo/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 02vue-demo 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/02vue-demo/src/App.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 49 | 50 | 52 | -------------------------------------------------------------------------------- /vue/02vue-demo/src/components/HomeTable.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /vue/02vue-demo/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import ElementUI from 'element-ui'; 4 | import 'element-ui/lib/theme-chalk/index.css'; 5 | Vue.config.productionTip = false 6 | Vue.use(ElementUI); 7 | new Vue({ 8 | render: h => h(App), 9 | }).$mount('#app') 10 | -------------------------------------------------------------------------------- /vue/02vue-demo/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports={ 2 | lintOnSave:false 3 | } -------------------------------------------------------------------------------- /vue/03vue-todolist/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/03vue-todolist/README.md: -------------------------------------------------------------------------------- 1 | # 03vue-todolist 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/03vue-todolist/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/03vue-todolist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "03vue-todolist", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.3.2", 12 | "vue": "^2.6.10" 13 | }, 14 | "devDependencies": { 15 | "@vue/cli-plugin-babel": "^4.0.0", 16 | "@vue/cli-plugin-eslint": "^4.0.0", 17 | "@vue/cli-service": "^4.0.0", 18 | "babel-eslint": "^10.0.3", 19 | "eslint": "^5.16.0", 20 | "eslint-plugin-vue": "^5.0.0", 21 | "vue-template-compiler": "^2.6.10" 22 | }, 23 | "eslintConfig": { 24 | "root": true, 25 | "env": { 26 | "node": true 27 | }, 28 | "extends": [ 29 | "plugin:vue/essential", 30 | "eslint:recommended" 31 | ], 32 | "rules": {}, 33 | "parserOptions": { 34 | "parser": "babel-eslint" 35 | } 36 | }, 37 | "postcss": { 38 | "plugins": { 39 | "autoprefixer": {} 40 | } 41 | }, 42 | "browserslist": [ 43 | "> 1%", 44 | "last 2 versions" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /vue/03vue-todolist/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/03vue-todolist/public/favicon.ico -------------------------------------------------------------------------------- /vue/03vue-todolist/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 03vue-todolist 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/03vue-todolist/src/App.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 40 | -------------------------------------------------------------------------------- /vue/03vue-todolist/src/components/HomeTable.vue: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /vue/03vue-todolist/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App), 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /vue/03vue-todolist/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports={ 2 | lintOnSave:false 3 | } -------------------------------------------------------------------------------- /vue/06cart/01filter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 |
13 | {{msg | format(2)}} 14 |
15 | 29 | 30 | -------------------------------------------------------------------------------- /vue/06cart/02计算属性.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 | 价格: 13 | 数量: 14 | 总价:{{total}} 15 |
16 | 30 | 31 | -------------------------------------------------------------------------------- /vue/06cart/03get-set.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /vue/06cart/04checkbox-change.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 | 13 |
14 | 27 | 28 | -------------------------------------------------------------------------------- /vue/06cart/05foreach.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /vue/06cart/06every.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /vue/06cart/07购物车.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 | 21 | 22 | 23 |
24 |

购物车

25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 46 | 47 | 48 | 49 | 52 | 53 | 54 |
全选 商品单价数量小计操作
40 | 41 | 43 | 44 | {{item.productName}} 45 | {{item.productPrice}}{{item.productPrice*item.productCount | format(2)}} 50 | 51 |
55 |

总价格:{{sum() | format(2)}}

56 | 57 |
58 | 102 | 103 | -------------------------------------------------------------------------------- /vue/06cart/09cart-computed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 | 21 | 22 | 23 |
24 |

购物车

25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 46 | 47 | 48 | 49 | 52 | 53 | 54 |
全选 商品单价数量小计操作
40 | 41 | 43 | 44 | {{item.productName}} 45 | {{item.productPrice}}{{item.productPrice*item.productCount | format(2)}} 50 | 51 |
55 |

总价格:{{sum | format(2)}}

56 | 57 |
58 | 105 | 106 | -------------------------------------------------------------------------------- /vue/06cart/data/carts.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "isSelected": true, 4 | "productCover": "https://img3.doubanio.com/view/subject/m/public/s33510542.jpg", 5 | "productName": "纸上行舟", 6 | "productInfo": "青年作者黎幺短篇小说首度结集", 7 | "productPrice": 57.33, 8 | "productCount": 3, 9 | "id": "0001" 10 | }, 11 | { 12 | "isSelected": true, 13 | "productCover": "https://img3.doubanio.com/view/subject/m/public/s33497735.jpg", 14 | "productName": "我可能得抑郁症了!舟", 15 | "productInfo": "青年作者黎幺短篇小说首度结集", 16 | "productPrice": 54.26, 17 | "productCount": 2, 18 | "id": "0002" 19 | }, 20 | { 21 | "isSelected": true, 22 | "productCover": "https://img3.doubanio.com/view/subject/m/public/s33474961.jpg", 23 | "productName": "绕日飞行", 24 | "productInfo": "驯马、飞行、成长、爱情", 25 | "productPrice": 22.67, 26 | "productCount": 3, 27 | "id": "0003" 28 | } 29 | ] -------------------------------------------------------------------------------- /vue/07rem-router/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/07rem-router/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/07rem-router/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/07rem-router/README.md: -------------------------------------------------------------------------------- 1 | ### 1.安装rem 2 | 3 | ``` 4 | yarn add lib-flexible postcss-pxtorem 5 | ``` 6 | 7 | ### 2.postcss.config.js 8 | 9 | ```js 10 | module.exports = { 11 | plugins: { 12 | autoprefixer: {}, 13 | 'postcss-pxtorem': { 14 | rootValue: 75, 15 | propList: ['*'] 16 | } 17 | } 18 | } 19 | ``` 20 | 21 | ### 3.main.js导入 22 | 23 | ``` 24 | import 'lib-flexible/flexible' 25 | ``` 26 | 27 | 28 | 29 | ### 1.安装 30 | 31 | ``` 32 | yarn add vue-router 33 | ``` 34 | 35 | ### 2.routers/index.js 36 | 37 | 38 | 39 | ## 三、拆分配置文件 40 | 41 | //main.js 42 | 43 | ```js 44 | import Vue from 'vue' 45 | import App from './App.vue' 46 | import router from './routers' 47 | import '../utils/config' 48 | Vue.config.productionTip = false 49 | new Vue({ 50 | router, 51 | render: h => h(App), 52 | }).$mount('#app') 53 | 54 | ``` 55 | 56 | //utils/config.js 57 | 58 | ```js 59 | import Vue from 'vue'; 60 | import 'lib-flexible/flexible' 61 | import BsBtn from '@/components/BsBtn.vue' 62 | Vue.filter("format",function(val){ 63 | if(val.length>6){ 64 | val=val.slice(0,6)+"..." 65 | } 66 | return val 67 | }) 68 | Vue.component('BsBtn',BsBtn) 69 | export default Vue 70 | 71 | ``` 72 | 73 | -------------------------------------------------------------------------------- /vue/07rem-router/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/07rem-router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "07rem-router", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.19.0", 12 | "axios-jsonp": "^1.0.2", 13 | "core-js": "^3.3.2", 14 | "lib-flexible": "^0.3.2", 15 | "postcss-pxtorem": "^4.0.1", 16 | "vue": "^2.6.10", 17 | "vue-router": "^3.1.3" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "^4.0.0", 21 | "@vue/cli-plugin-eslint": "^4.0.0", 22 | "@vue/cli-service": "^4.0.0", 23 | "babel-eslint": "^10.0.3", 24 | "eslint": "^5.16.0", 25 | "eslint-plugin-vue": "^5.0.0", 26 | "less": "^3.0.4", 27 | "less-loader": "^5.0.0", 28 | "vue-template-compiler": "^2.6.10" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vue/07rem-router/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {}, 4 | 'postcss-pxtorem': { 5 | rootValue: 75, 6 | propList: ['*'] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vue/07rem-router/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/07rem-router/public/favicon.ico -------------------------------------------------------------------------------- /vue/07rem-router/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 07rem-router 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/07rem-router/src/App.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 22 | 23 | 39 | -------------------------------------------------------------------------------- /vue/07rem-router/src/assets/css/reset.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/07rem-router/src/assets/css/reset.css -------------------------------------------------------------------------------- /vue/07rem-router/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/07rem-router/src/assets/logo.png -------------------------------------------------------------------------------- /vue/07rem-router/src/components/BsBtn.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /vue/07rem-router/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './routers' 4 | import '../utils/config' 5 | Vue.config.productionTip = false 6 | new Vue({ 7 | router, 8 | render: h => h(App), 9 | }).$mount('#app') 10 | -------------------------------------------------------------------------------- /vue/07rem-router/src/pages/All/Item.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /vue/07rem-router/src/pages/All/components/Item.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | 20 | -------------------------------------------------------------------------------- /vue/07rem-router/src/pages/All/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 26 | 27 | -------------------------------------------------------------------------------- /vue/07rem-router/src/pages/Music/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 22 | 23 | -------------------------------------------------------------------------------- /vue/07rem-router/src/pages/Mv/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /vue/07rem-router/src/routers/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import Music from '@/pages/Music' 4 | import Mv from '@/pages/Mv' 5 | import All from '@/pages/All' 6 | Vue.use(Router); 7 | export default new Router({ 8 | mode:"hash", 9 | routes:[ 10 | { 11 | path:'/music', 12 | name:"music", 13 | component:Music 14 | }, 15 | { 16 | path:'/mv', 17 | name:"mv", 18 | component:Mv 19 | }, 20 | { 21 | path:'/all', 22 | name:"all", 23 | component:All 24 | } 25 | ] 26 | }) -------------------------------------------------------------------------------- /vue/07rem-router/utils/config.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import 'lib-flexible/flexible' 3 | import BsBtn from '@/components/BsBtn.vue' 4 | import axios from 'axios' 5 | Vue.filter("format",function(val){ 6 | if(val.length>6){ 7 | val=val.slice(0,6)+"..." 8 | } 9 | return val 10 | }) 11 | Vue.prototype.axios=axios 12 | Vue.component('BsBtn',BsBtn) 13 | export default Vue 14 | -------------------------------------------------------------------------------- /vue/08get/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/08get/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/08get/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/08get/README.md: -------------------------------------------------------------------------------- 1 | ### 1.安装rem 2 | 3 | ``` 4 | yarn add lib-flexible postcss-pxtorem 5 | ``` 6 | 7 | ### 2.postcss.config.js 8 | 9 | ```js 10 | module.exports = { 11 | plugins: { 12 | autoprefixer: {}, 13 | 'postcss-pxtorem': { 14 | rootValue: 75, 15 | propList: ['*'] 16 | } 17 | } 18 | } 19 | ``` 20 | 21 | ### 3.main.js导入 22 | 23 | ``` 24 | import 'lib-flexible/flexible' 25 | ``` 26 | 27 | 28 | 29 | ### 1.安装 30 | 31 | ``` 32 | yarn add vue-router 33 | ``` 34 | 35 | ### 2.routers/index.js 36 | 37 | 38 | 39 | ## 三、拆分配置文件 40 | 41 | //main.js 42 | 43 | ```js 44 | import Vue from 'vue' 45 | import App from './App.vue' 46 | import router from './routers' 47 | import '../utils/config' 48 | Vue.config.productionTip = false 49 | new Vue({ 50 | router, 51 | render: h => h(App), 52 | }).$mount('#app') 53 | 54 | ``` 55 | 56 | //utils/config.js 57 | 58 | ```js 59 | import Vue from 'vue'; 60 | import 'lib-flexible/flexible' 61 | import BsBtn from '@/components/BsBtn.vue' 62 | Vue.filter("format",function(val){ 63 | if(val.length>6){ 64 | val=val.slice(0,6)+"..." 65 | } 66 | return val 67 | }) 68 | Vue.component('BsBtn',BsBtn) 69 | export default Vue 70 | 71 | ``` 72 | 73 | -------------------------------------------------------------------------------- /vue/08get/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/08get/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "07rem-router", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.19.0", 12 | "axios-jsonp": "^1.0.2", 13 | "core-js": "^3.3.2", 14 | "lib-flexible": "^0.3.2", 15 | "postcss-pxtorem": "^4.0.1", 16 | "vue": "^2.6.10", 17 | "vue-router": "^3.1.3" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "^4.0.0", 21 | "@vue/cli-plugin-eslint": "^4.0.0", 22 | "@vue/cli-service": "^4.0.0", 23 | "babel-eslint": "^10.0.3", 24 | "eslint": "^5.16.0", 25 | "eslint-plugin-vue": "^5.0.0", 26 | "less": "^3.0.4", 27 | "less-loader": "^5.0.0", 28 | "vue-template-compiler": "^2.6.10" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vue/08get/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {}, 4 | 'postcss-pxtorem': { 5 | rootValue: 75, 6 | propList: ['*'] 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vue/08get/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/08get/public/favicon.ico -------------------------------------------------------------------------------- /vue/08get/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 07rem-router 10 | 11 | 12 | 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /vue/08get/src/App.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 22 | 23 | 36 | -------------------------------------------------------------------------------- /vue/08get/src/assets/css/reset.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/08get/src/assets/css/reset.css -------------------------------------------------------------------------------- /vue/08get/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/08get/src/assets/logo.png -------------------------------------------------------------------------------- /vue/08get/src/components/BsBtn.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /vue/08get/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './routers' 4 | import './utils/config' 5 | Vue.config.productionTip = false 6 | new Vue({ 7 | router, 8 | render: h => h(App), 9 | }).$mount('#app') 10 | -------------------------------------------------------------------------------- /vue/08get/src/pages/All/components/Item.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 25 | 26 | -------------------------------------------------------------------------------- /vue/08get/src/pages/All/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 26 | 27 | -------------------------------------------------------------------------------- /vue/08get/src/pages/Detail/index.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 47 | 48 | -------------------------------------------------------------------------------- /vue/08get/src/pages/Music/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 22 | 23 | -------------------------------------------------------------------------------- /vue/08get/src/pages/Mv/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /vue/08get/src/routers/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import Music from '@/pages/Music' 4 | import Mv from '@/pages/Mv' 5 | import All from '@/pages/All' 6 | // import Detail from '@/pages/Detail' 7 | Vue.use(Router); 8 | export default new Router({ 9 | mode:"hash", 10 | routes:[ 11 | { 12 | path:'/music', 13 | name:"music", 14 | component:Music 15 | }, 16 | { 17 | path:'/mv', 18 | name:"mv", 19 | component:Mv 20 | }, 21 | { 22 | path:'/all', 23 | name:"all", 24 | component:All 25 | }, 26 | { 27 | path:'/detail', 28 | name:"detail", 29 | /* 异步路由 */ 30 | component:()=>import('@/pages/Detail') 31 | } 32 | ] 33 | }) -------------------------------------------------------------------------------- /vue/08get/src/utils/config.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import 'lib-flexible/flexible' 3 | import BsBtn from '@/components/BsBtn.vue' 4 | import axios from 'axios' 5 | Vue.filter("format",function(val){ 6 | if(val.length>6){ 7 | val=val.slice(0,6)+"..." 8 | } 9 | return val 10 | }) 11 | Vue.prototype.axios=axios 12 | Vue.component('BsBtn',BsBtn) 13 | export default Vue 14 | -------------------------------------------------------------------------------- /vue/09music/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/09music/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/09music/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/09music/README.md: -------------------------------------------------------------------------------- 1 | # 09music 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/09music/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/09music/mock/cart.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "isSelected": true, 4 | "productCover": "https://img3.doubanio.com/view/subject/m/public/s33510542.jpg", 5 | "productName": "纸上行舟", 6 | "productInfo": "青年作者黎幺短篇小说首度结集", 7 | "productPrice": 57.33, 8 | "productCount": 3, 9 | "id": "0001" 10 | }, 11 | { 12 | "isSelected": true, 13 | "productCover": "https://img3.doubanio.com/view/subject/m/public/s33497735.jpg", 14 | "productName": "我可能得抑郁症了!舟", 15 | "productInfo": "青年作者黎幺短篇小说首度结集", 16 | "productPrice": 54.26, 17 | "productCount": 2, 18 | "id": "0002" 19 | }, 20 | { 21 | "isSelected": true, 22 | "productCover": "https://img3.doubanio.com/view/subject/m/public/s33474961.jpg", 23 | "productName": "绕日飞行", 24 | "productInfo": "驯马、飞行、成长、爱情", 25 | "productPrice": 22.67, 26 | "productCount": 3, 27 | "id": "0003" 28 | } 29 | ] -------------------------------------------------------------------------------- /vue/09music/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "09music", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.19.0", 12 | "core-js": "^3.3.2", 13 | "vue": "^2.6.10", 14 | "vue-router": "^3.1.3" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "^4.0.0", 18 | "@vue/cli-plugin-eslint": "^4.0.0", 19 | "@vue/cli-plugin-router": "^4.0.0", 20 | "@vue/cli-service": "^4.0.0", 21 | "babel-eslint": "^10.0.3", 22 | "eslint": "^5.16.0", 23 | "eslint-plugin-vue": "^5.0.0", 24 | "vue-template-compiler": "^2.6.10" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue/09music/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vue/09music/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/09music/public/favicon.ico -------------------------------------------------------------------------------- /vue/09music/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 09music 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/09music/src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 33 | -------------------------------------------------------------------------------- /vue/09music/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/09music/src/assets/logo.png -------------------------------------------------------------------------------- /vue/09music/src/assets/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/09music/src/assets/pause.png -------------------------------------------------------------------------------- /vue/09music/src/assets/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/09music/src/assets/play.png -------------------------------------------------------------------------------- /vue/09music/src/components/Fade.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /vue/09music/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | Vue.config.productionTip = false 5 | new Vue({ 6 | router, 7 | render: h => h(App) 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /vue/09music/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'home', 11 | component: Home 12 | }, 13 | { 14 | path: '/about', 15 | name: 'about', 16 | component: () => import( '../views/About.vue') 17 | }, 18 | { 19 | path: '/audio', 20 | name: 'audio', 21 | component: () => import( '../views/Audio.vue') 22 | } 23 | ] 24 | 25 | const router = new VueRouter({ 26 | mode: 'history', 27 | base: process.env.BASE_URL, 28 | routes 29 | }) 30 | 31 | export default router 32 | -------------------------------------------------------------------------------- /vue/09music/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 9 | 29 | -------------------------------------------------------------------------------- /vue/09music/src/views/Audio.vue: -------------------------------------------------------------------------------- 1 | 10 | 40 | 45 | -------------------------------------------------------------------------------- /vue/09music/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 31 | -------------------------------------------------------------------------------- /vue/09music/vue.config.js: -------------------------------------------------------------------------------- 1 | const mockIndexData = require("./mock/cart.json"); 2 | module.exports = { 3 | devServer: { 4 | port: 8080, 5 | before(app) { 6 | app.get("/cart", (req, res) => { 7 | res.json(mockIndexData); 8 | }); 9 | } 10 | } 11 | }; -------------------------------------------------------------------------------- /vue/10checkbox/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/10checkbox/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/10checkbox/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/10checkbox/README.md: -------------------------------------------------------------------------------- 1 | # 10storage 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/10checkbox/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/10checkbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "10storage", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "amfe-flexible": "^2.2.1", 12 | "core-js": "^3.3.2", 13 | "lib-flexible": "^0.3.2", 14 | "postcss-pxtorem": "^4.0.1", 15 | "vue": "^2.6.10", 16 | "vue-router": "^3.1.3" 17 | }, 18 | "devDependencies": { 19 | "@vue/cli-plugin-babel": "^4.0.0", 20 | "@vue/cli-plugin-eslint": "^4.0.0", 21 | "@vue/cli-plugin-router": "^4.0.0", 22 | "@vue/cli-service": "^4.0.0", 23 | "babel-eslint": "^10.0.3", 24 | "eslint": "^5.16.0", 25 | "eslint-plugin-vue": "^5.0.0", 26 | "sass": "^1.19.0", 27 | "sass-loader": "^8.0.0", 28 | "vue-template-compiler": "^2.6.10" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vue/10checkbox/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'autoprefixer': { 4 | browsers: ['Android >= 4.0', 'iOS >= 7'] 5 | }, 6 | 'postcss-pxtorem': { 7 | rootValue: 37.5, 8 | propList: ['*'] 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /vue/10checkbox/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/10checkbox/public/favicon.ico -------------------------------------------------------------------------------- /vue/10checkbox/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10storage 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/10checkbox/src/App.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 34 | -------------------------------------------------------------------------------- /vue/10checkbox/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/10checkbox/src/assets/logo.png -------------------------------------------------------------------------------- /vue/10checkbox/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import 'amfe-flexible/index' 5 | Vue.config.productionTip = false 6 | 7 | new Vue({ 8 | router, 9 | render: h => h(App) 10 | }).$mount('#app') 11 | -------------------------------------------------------------------------------- /vue/10checkbox/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'home', 11 | component: Home 12 | }, 13 | { 14 | path: '/about', 15 | name: 'about', 16 | // route level code-splitting 17 | // this generates a separate chunk (about.[hash].js) for this route 18 | // which is lazy-loaded when the route is visited. 19 | component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') 20 | } 21 | ] 22 | 23 | const router = new VueRouter({ 24 | mode: 'history', 25 | base: process.env.BASE_URL, 26 | routes 27 | }) 28 | 29 | export default router 30 | -------------------------------------------------------------------------------- /vue/10checkbox/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | 50 | -------------------------------------------------------------------------------- /vue/10checkbox/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 52 | -------------------------------------------------------------------------------- /vue/10storage/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/10storage/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/10storage/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/10storage/README.md: -------------------------------------------------------------------------------- 1 | # 10storage 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/10storage/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/10storage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "10storage", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "core-js": "^3.3.2", 12 | "vue": "^2.6.10", 13 | "vue-router": "^3.1.3" 14 | }, 15 | "devDependencies": { 16 | "@vue/cli-plugin-babel": "^4.0.0", 17 | "@vue/cli-plugin-eslint": "^4.0.0", 18 | "@vue/cli-plugin-router": "^4.0.0", 19 | "@vue/cli-service": "^4.0.0", 20 | "babel-eslint": "^10.0.3", 21 | "eslint": "^5.16.0", 22 | "eslint-plugin-vue": "^5.0.0", 23 | "sass": "^1.19.0", 24 | "sass-loader": "^8.0.0", 25 | "vue-template-compiler": "^2.6.10" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vue/10storage/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vue/10storage/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/10storage/public/favicon.ico -------------------------------------------------------------------------------- /vue/10storage/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10storage 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/10storage/src/App.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 33 | -------------------------------------------------------------------------------- /vue/10storage/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/10storage/src/assets/logo.png -------------------------------------------------------------------------------- /vue/10storage/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | 5 | Vue.config.productionTip = false 6 | 7 | new Vue({ 8 | router, 9 | render: h => h(App) 10 | }).$mount('#app') 11 | -------------------------------------------------------------------------------- /vue/10storage/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'home', 11 | component: Home 12 | }, 13 | { 14 | path: '/about', 15 | name: 'about', 16 | // route level code-splitting 17 | // this generates a separate chunk (about.[hash].js) for this route 18 | // which is lazy-loaded when the route is visited. 19 | component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') 20 | } 21 | ] 22 | 23 | const router = new VueRouter({ 24 | mode: 'history', 25 | base: process.env.BASE_URL, 26 | routes 27 | }) 28 | 29 | export default router 30 | -------------------------------------------------------------------------------- /vue/10storage/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /vue/10storage/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 40 | -------------------------------------------------------------------------------- /vue/vue-day01/01hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 | {{msg}} 13 |

{{item}}

14 |
15 | 23 | 24 | -------------------------------------------------------------------------------- /vue/vue-day01/02for-key.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 |

{{item.name}}{{index}}

13 |
14 | 28 | 29 | -------------------------------------------------------------------------------- /vue/vue-day01/03v-if.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 15 |
16 |

显示隐藏 IF

17 |

显示隐藏 SHOW

18 |
19 |
20 | 32 | 33 | -------------------------------------------------------------------------------- /vue/vue-day01/04input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 | 12 | 14 |
15 | 16 | {{keyword}} 17 |
18 | 37 | 38 | -------------------------------------------------------------------------------- /vue/vue-day01/05计算属性.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 | {{this.total}} 13 |
14 | 31 | 32 | -------------------------------------------------------------------------------- /vue/vue-day01/06watch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 | {{this.firstName + this.lastName}} 13 |
14 | 35 | 36 | -------------------------------------------------------------------------------- /vue/vue-day01/07class.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 |

hello world

13 |

14 |
15 | 26 | 27 | -------------------------------------------------------------------------------- /vue/vue-day01/08方法.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 |

{{msg}}

13 | 14 |
15 | 30 | 31 | -------------------------------------------------------------------------------- /vue/vue-day01/09todoList.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 10 | 11 | 12 | 13 |
14 |
15 | 姓名: 16 | 年龄: 17 | 18 |
19 |
20 |

{{item.name}}:{{item.age}}

21 |
22 |
23 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /vue/vue-day01/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day01/readme.md -------------------------------------------------------------------------------- /vue/vue-day11/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/vue-day11/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/vue-day11/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/vue-day11/README.md: -------------------------------------------------------------------------------- 1 | # vue-day12 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/vue-day11/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/vue-day11/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-day12", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.19.0", 12 | "core-js": "^3.3.2", 13 | "vue": "^2.6.10", 14 | "vue-router": "^3.1.3" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "^4.0.0", 18 | "@vue/cli-plugin-eslint": "^4.0.0", 19 | "@vue/cli-plugin-router": "^4.0.0", 20 | "@vue/cli-service": "^4.0.0", 21 | "babel-eslint": "^10.0.3", 22 | "eslint": "^5.16.0", 23 | "eslint-plugin-vue": "^5.0.0", 24 | "sass": "^1.19.0", 25 | "sass-loader": "^8.0.0", 26 | "vue-template-compiler": "^2.6.10" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vue/vue-day11/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vue/vue-day11/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day11/public/favicon.ico -------------------------------------------------------------------------------- /vue/vue-day11/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vue-day12 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/vue-day11/src/App.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 37 | -------------------------------------------------------------------------------- /vue/vue-day11/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day11/src/assets/logo.png -------------------------------------------------------------------------------- /vue/vue-day11/src/components/Count.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /vue/vue-day11/src/components/Dialog.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | 21 | -------------------------------------------------------------------------------- /vue/vue-day11/src/components/One.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /vue/vue-day11/src/components/Test.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /vue/vue-day11/src/components/Two.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /vue/vue-day11/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import axios from 'axios' 5 | // import {Button} from 'vant' 6 | Vue.config.productionTip = false 7 | Vue.prototype.axios=axios 8 | // Vue.use(Button) 9 | new Vue({ 10 | router, 11 | render: h => h(App) 12 | }).$mount('#app') 13 | -------------------------------------------------------------------------------- /vue/vue-day11/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'home', 11 | component: Home 12 | }, 13 | { 14 | path: '/about', 15 | name: 'about', 16 | component: () => import( '../views/About.vue') 17 | }, 18 | { 19 | path: '/center', 20 | name: 'center', 21 | component: () => import( '../views/Center.vue') 22 | }, 23 | { 24 | path: '/detail/:id', 25 | name: 'detail', 26 | component: () => import( '../views/Detail.vue') 27 | }, 28 | { 29 | path: '/movie', 30 | name: 'movie', 31 | component: () => import( '../views/Movie.vue') 32 | } 33 | ] 34 | 35 | const router = new VueRouter({ 36 | mode: 'history', 37 | base: process.env.BASE_URL, 38 | routes 39 | }) 40 | 41 | export default router 42 | -------------------------------------------------------------------------------- /vue/vue-day11/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /vue/vue-day11/src/views/Center.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 38 | 39 | -------------------------------------------------------------------------------- /vue/vue-day11/src/views/Detail.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 34 | 35 | -------------------------------------------------------------------------------- /vue/vue-day11/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 41 | -------------------------------------------------------------------------------- /vue/vue-day11/src/views/Movie.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 25 | 26 | -------------------------------------------------------------------------------- /vue/vue-day12/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/vue-day12/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/vue-day12/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/vue-day12/README.md: -------------------------------------------------------------------------------- 1 | # vue-day13 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/vue-day12/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/vue-day12/gaode.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | Document 11 | 17 | 18 | 19 | 20 |
21 |
22 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /vue/vue-day12/map.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Document 9 | 11 | 26 | 27 | 28 | 29 |
30 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /vue/vue-day12/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-day13", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "autoprefixer": "^9.7.2", 12 | "axios": "^0.19.0", 13 | "core-js": "^3.3.2", 14 | "cssnano": "^4.1.10", 15 | "cssnano-preset-advanced": "^4.0.7", 16 | "postcss-aspect-ratio-mini": "^1.0.1", 17 | "postcss-cssnext": "^3.1.0", 18 | "postcss-import": "^12.0.1", 19 | "postcss-px-to-viewport": "^1.1.1", 20 | "postcss-url": "^8.0.0", 21 | "postcss-viewport-units": "^0.1.6", 22 | "postcss-write-svg": "^3.0.1", 23 | "vue": "^2.6.10", 24 | "vue-router": "^3.1.3", 25 | "vuex": "^3.0.1" 26 | }, 27 | "devDependencies": { 28 | "@vue/cli-plugin-babel": "^4.0.0", 29 | "@vue/cli-plugin-eslint": "^4.0.0", 30 | "@vue/cli-plugin-router": "^4.0.0", 31 | "@vue/cli-plugin-vuex": "^4.0.0", 32 | "@vue/cli-service": "^4.0.0", 33 | "babel-eslint": "^10.0.3", 34 | "eslint": "^5.16.0", 35 | "eslint-plugin-vue": "^5.0.0", 36 | "sass": "^1.19.0", 37 | "sass-loader": "^8.0.0", 38 | "vue-template-compiler": "^2.6.10" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vue/vue-day12/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "plugins": { 3 | "postcss-import": {}, 4 | "postcss-url": {}, 5 | "postcss-aspect-ratio-mini": {}, 6 | "postcss-write-svg": { 7 | utf8: false 8 | }, 9 | "postcss-cssnext": {}, 10 | "postcss-px-to-viewport": { 11 | viewportWidth: 750, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750 12 | viewportHeight: 1334, // 视窗的高度,根据750设备的宽度来指定,一般指定1334,也可以不配置 13 | unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除) 14 | viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw 15 | selectorBlackList: ['.ignore', '.hairlines'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 16 | minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值 17 | mediaQuery: false // 允许在媒体查询中转换`px` 18 | }, 19 | "postcss-viewport-units":{}, 20 | "cssnano": { 21 | preset: "advanced", 22 | autoprefixer: false, 23 | "postcss-zindex": false 24 | }, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue/vue-day12/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day12/public/favicon.ico -------------------------------------------------------------------------------- /vue/vue-day12/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vue-day13 9 | 10 | 11 | 14 |
15 | 16 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /vue/vue-day12/src/App.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 40 | -------------------------------------------------------------------------------- /vue/vue-day12/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day12/src/assets/logo.png -------------------------------------------------------------------------------- /vue/vue-day12/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import axios from 'axios' 6 | Vue.config.productionTip = false 7 | Vue.prototype.axios = axios 8 | // Add a request interceptor 9 | axios.interceptors.request.use(function (config) { 10 | // Do something before request is sent 11 | store.state.isLoading = true 12 | return config; 13 | }); 14 | 15 | // Add a response interceptor 16 | axios.interceptors.response.use(function (response) { 17 | // Do something with response data 18 | store.state.isLoading = false 19 | return response; 20 | }); 21 | new Vue({ 22 | router, 23 | store, 24 | render: h => h(App) 25 | }).$mount('#app') 26 | -------------------------------------------------------------------------------- /vue/vue-day12/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Films from '../views/Films.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/films', 10 | name: 'films', 11 | component: Films, 12 | children:[ 13 | { 14 | path:'nowPlaying', 15 | component:()=>import('../views/NowPlaying.vue') 16 | }, 17 | { 18 | path:'comingSoon', 19 | component:()=>import('../views/ComingSoon.vue') 20 | } 21 | ], 22 | redirect:"/films/nowPlaying" 23 | }, 24 | { 25 | path: '/about', 26 | name: 'about', 27 | component: () => import('../views/About.vue') 28 | }, 29 | { 30 | path: '/detail', 31 | name: 'detail', 32 | component: () => import('../views/Detail.vue') 33 | }, 34 | { 35 | path: '/', 36 | redirect:"/films/nowPlaying" 37 | } 38 | ] 39 | 40 | const router = new VueRouter({ 41 | mode: 'hash', 42 | base: process.env.BASE_URL, 43 | routes 44 | }) 45 | 46 | export default router 47 | -------------------------------------------------------------------------------- /vue/vue-day12/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | function getCity(){ 6 | let defaultCity="武汉"; 7 | if(localStorage.getItem("city")){ 8 | defaultCity=localStorage.getItem("city") 9 | } 10 | return defaultCity 11 | } 12 | export default new Vuex.Store({ 13 | state: { 14 | city:getCity(), 15 | isLoading:false 16 | }, 17 | mutations: { 18 | changeCity(state,city){ 19 | state.city=city 20 | } 21 | }, 22 | actions: { 23 | changeCity(ctx,city){ 24 | ctx.commit("changeCity",city) 25 | localStorage.setItem("city",city) 26 | } 27 | }, 28 | modules: { 29 | } 30 | }) 31 | -------------------------------------------------------------------------------- /vue/vue-day12/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 11 | 42 | 52 | -------------------------------------------------------------------------------- /vue/vue-day12/src/views/ComingSoon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /vue/vue-day12/src/views/Detail.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | 25 | -------------------------------------------------------------------------------- /vue/vue-day12/src/views/Films.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 28 | -------------------------------------------------------------------------------- /vue/vue-day12/src/views/NowPlaying.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /vue/vue-day13/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /vue/vue-day13/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | 'eslint:recommended' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vue/vue-day13/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /vue/vue-day13/README.md: -------------------------------------------------------------------------------- 1 | # vue-day13 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /vue/vue-day13/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /vue/vue-day13/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 | 35 | -------------------------------------------------------------------------------- /vue/vue-day13/mock/cart.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "date": "Sep 18 2016", 4 | "title": "正是虾肥蟹壮时", 5 | "imgSrc": "https://i.loli.net/2019/10/21/RW6cZPpXtxMsUjv.png", 6 | avatar: "https://i.loli.net/2019/10/21/5tdK89ezqExAfwM.png", 7 | "content": "菊黄蟹正肥,品尝秋之味。徐志摩把,“看初花的荻芦”和“到楼外楼吃蟹”,并列为秋天来杭州不能错过的风雅之事;用林妹妹的话讲是“螯封嫩玉双双满,", 8 | "reading": "112", 9 | collection: "96", 10 | "headimgSrc": "https://i.loli.net/2019/10/21/RW6cZPpXtxMsUjv.png", 11 | author: "林白衣", 12 | dateTime: "24小时前", 13 | "detail": "菊黄蟹正肥,品尝秋之味。徐志摩把“看初花的荻芦”和“到楼外楼吃蟹”并列为秋天来杭州不能错过的风雅之事;用林妹妹的话讲是“螯封嫩玉双双满,壳凸红脂块块香”;在《世说新语》里,晋毕卓更是感叹“右手持酒杯,左手持蟹螯,拍浮酒船中,便足了一生矣。”漫漫人生长路,美食与爱岂可辜负?于是作为一个吃货,突然也很想回味一下属于我的味蕾记忆。记忆中的秋蟹,是家人的味道,弥漫着浓浓的亲情。\n\n是谁来自山川湖海,却囿于昼夜,厨房与爱? 是母亲,深思熟虑,聪明耐心。吃蟹前,总会拿出几件工具,煞有介事而乐此不疲。告诉我们螃蟹至寒,需要佐以姜茶以祛寒,在配备的米醋小碟里,亦添入姜丝与紫苏,前者驱寒后者增香。泡好菊花茶,岁月静好,我们静等。", 14 | postId: 0, 15 | music: { 16 | url: "http://music.163.com/song/media/outer/url?id=108390", 17 | "title": "往后余生", 18 | coverImg: "http://p4.music.126.net/J-So8uu3Mo9zKfN128L_pQ==/109951162875623128.jpg" 19 | } 20 | }, 21 | { 22 | "title": "比利·林恩的中场故事", 23 | "content": "一 “李安是一位绝不会重复自己的导演,本片将极富原创性李安众所瞩目的新片《比利林恩漫长的中场休息》,正式更名《半场无战事》。", 24 | "imgSrc": "https://i.loli.net/2019/10/21/3IOmYMGgBfrQ1Sv.png", 25 | "reading": 62, 26 | "detail": "一 “李安是一位绝不会重复自己的导演,本片将极富原创性”李安众所瞩目的新片《比利林恩漫长的中场休息》,正式更名《半场无战事》。预告片首次曝光后,被视作是明年奥斯卡种子选手。该片根据同名畅销书改编。原著小说荣获美国国家图书奖。也被BBC评为21世纪最伟大的12本英文小说之一。影片讲述一位19岁德州男孩的比利·林恩入伍参加伊战,在一次交火中他大难不死,意外与战友成为大众的关注焦点,并被塑造成英雄。之后他们返回国内,在橄榄球赛中场休息时授勋。这名战争英雄却面临前所未有的心灵煎熬……李安为什么选中这部电影来拍?因为李安想要挑战前所未有的技术难题:以120帧每秒的速度、4K、3D技术全面结合,来掀起一场电影视觉革命。什么意思?所谓“电影是24格每秒的谎言”,其中的24格,就是帧数。", 27 | collection: 92, 28 | dateTime: "24小时前", 29 | "headimgSrc": "https://i.loli.net/2019/10/21/3IOmYMGgBfrQ1Sv.png", 30 | author: "迷的城", 31 | date: "Nov 20 2016", 32 | avatar: "https://i.loli.net/2019/10/21/5tdK89ezqExAfwM.png", 33 | postId: 1, 34 | music: { 35 | url: "http://music.163.com/song/media/outer/url?id=30814948", 36 | "title": "从前慢", 37 | coverImg: "http://y.gtimg.cn/music/photo_new/T002R150x150M000002xOmp62kqSic.jpg?max_age=2592000" 38 | } 39 | }, 40 | { 41 | "title": "当我们在谈论经济学时,我们在谈论什么?", 42 | "content"": "引言在我跟学生课后交流时,以及我在知乎上阅读有关“经济”问题的论题时,经常会遇到这样的情况:...", 43 | "detail": "1 引言\n\n在我跟学生课后交流时,以及我在知乎上阅读有关“经济”问题的论题时,经常会遇到这样的情况:有些人套用“经济理论“的知识去解释现实中发生的经济事件,结果发现很多事情讲不通,或者发现”理论告诉我们的“与现实发生的是相反的。也有学生经常跟我说:经济学有什么用?为了说明这个,我经常从两个方面来进行解释,尝试用我个人所擅长的解决问题的视角和他们能够听懂的方法来说明经济学是什么,它的作用边界在哪里:\r\n\n2 ”简笔素描“与”油画肖像“我们给人画肖像画,可以用简笔素描,也可以用油画肖像。油画肖像可以在最大程度上保存了人物的各方面的细节和特点,而简笔素描则忽略了很多细节。尽管简笔素描忽略了人物的许多细节,但我们仍旧能够很容易的认出画中的人物是谁。为什么?因为这种方法保留了人物最显著的特征,以至于我们可以忽略其次要特征而对人物做出判定。\n\n2.1 ”简笔素描“对于绝大多数的非经济学专业大众而言(经济学相关专业硕士学历以上),人们所接触到的经济学都是初级微观经济学。所谓的初级微观经济学,对于经济问题的”画法“就是一种”简笔素描“。比如初级微观经济学教材中广为使用的这种一元一次需求函数:y=bx+a,需求量的唯一变量是产品价格。但仅凭直觉我们就可以断言,现实中影响需求量的因素绝不止价格这一种,因此我们可以认为这个模型对经济问题的描述是失真的。然而但这种失真却是必要的和有意义的,其意义在与它利于揭示价格对于需求的影响,而不在于否定影响需求的其他因素——", 44 | "imgSrc": " https://i.loli.net/2019/10/21/fj6aQowIvE98X52.png", 45 | "headimgSrc": " https://i.loli.net/2019/10/21/fj6aQowIvE98X52.png", 46 | "reading": 62, 47 | collection: 92, 48 | author: "知乎", 49 | date: "Nov 12 2016", 50 | dateTime: "三天前", 51 | avatar: "https://i.loli.net/2019/10/21/XU9OPHxds5nqGyT.png", 52 | postId: 2, 53 | music: { 54 | url: "http://music.163.com/song/media/outer/url?id=32835566", 55 | "title": "从前的我", 56 | coverImg: "http://p3.music.126.net/1qdwtD9QaawDmX3JUE9raw==/109951162932623462.jpg" 57 | } 58 | }, 59 | { 60 | "title": "微信·小程序开发工具安装指南", 61 | "content": "这两天闲来无事,也安装了 “微信折叠”的开发工具来玩一下。以下是一些小道消息及使用体验,过两天我会写一篇文章以开发者的角度来详细评价微信小程序", 62 | "imgSrc": "/images/post/xiaolong.jpg", 63 | "reading": 102, 64 | "detail": "这两天闲来无事,也安装了 “微信折叠”的开发工具来玩一下。以下是一些小道消息及使用体验,过两天我会写一篇文章以开发者的角度来详细评价微信小程序:微信小程序不能开发游戏类、直播类功能,小程序每个人关注的上限是20个(还不确定,不过我相信这是真的,这次公布的API里并没有视频组件。微信太大,苹果要有所顾忌,但是微信也要做出相应的让步)微信目前有没有同苹果商谈好,还是个未知数,毕竟会对AppStore有一定的冲击。抛弃了大量的javascript组件后,这个生态体系变得相当的封闭,微信解释肯定是:为了更好的性能提升。那么我们拭目以待。小程序的入口是微信里的三级菜单,就是在“Tab栏发现里的游戏下面加入一个“小程序”。反正,这一栏里的购物和游戏我是从来没点进去过的。以腾讯的尿性,小程序同服务号一样,其关系链及重要功能的开放程度会因“人”而异。对,优质的接口只会开放给腾讯的儿子们(滴滴呀、京东呀)", 65 | collection: 92, 66 | dateTime: "24小时前", 67 | "headimgSrc": "https://i.loli.net/2019/10/21/BXQHYF3LAZkpI2P.jpg", 68 | author: "猫是猫的猫", 69 | date: "Nov 20 2016", 70 | avatar: "https://i.loli.net/2019/10/21/69uRNBXwaZMUOWo.png", 71 | postId: 3, 72 | music: { 73 | url: "http://music.163.com/song/media/outer/url?id=303283 ", 74 | "title": "爱情呼叫转移", 75 | coverImg: "http://p4.music.126.net/KfA50nsD2BVup_ACFRGPPA==/19017153114621423.jpg", 76 | } 77 | }, 78 | { 79 | "title": "从视觉到触觉 这款VR手套能给你真实触感", 80 | "content": "8月29日消息,据国外媒体VentureBeat报道,一家名为Dexta Robotics的公司最近发布了一款有望变革虚拟现实手部追踪与交互方式的新产品", 81 | "imgSrc": "https://i.loli.net/2019/10/21/Lm4S5EvsfBK17Qh.png", 82 | "reading": 102, 83 | "detail": "消息,据国外媒体VentureBeat报道,一家名为Dexta Robotics的公司最近发布了一款有望变革虚拟现实手部追踪与交互方式的新产品。该产品名为“Dexmo”,它是一款像手套那样戴在手上使用的未来主义外骨骼。它内置大量的元件,能够与VR体验进行交互,可帮助你感觉握在你的双手的虚拟物体。Dexmo据Dexta称,“Dexmo是一款针对你的双手的机械外骨骼。它能够捕捉你的手部运动,以及提供即时的力反馈。有了Dexmo,你可以感受到虚拟物体的大小、形状和坚硬度。你可以接触数字世界。”市面上已经有数款产品旨在处理虚拟现实中的手部交互,也有相关的产品即将要进入市场。例如,颇受欢迎的HTC Vive头盔配有一副控制器,其控制器能够使得追踪系统看到你的双手,让你可以用它们来在特定体验中与物体进行交互。今年晚些时候,Oculus将开始出货类似的手部控制产品Oculus Touch。10月,索尼也将开始出货配备两个PlayStation Move手部控制器的PS VR。Leap Motion甚至更进一步:利用传感器来追踪手指和手部的运动。", 84 | collection: 26, 85 | dateTime: "24小时前", 86 | "headimgSrc": "https://i.loli.net/2019/10/21/Lm4S5EvsfBK17Qh.png", 87 | author: "深白色", 88 | date: "Nov 20 2016", 89 | avatar: "https://i.loli.net/2019/10/21/XU9OPHxds5nqGyT.png", 90 | postId: 4, 91 | music: { 92 | url: "http://music.163.com/song/media/outer/url?id=32835566", 93 | "title": "往后余生", 94 | coverImg: "http://p3.music.126.net/T1nKA7zWLb8Y2vnzc5CeCQ==/3431575792207860.jpg" 95 | } 96 | }, 97 | { 98 | "title": "爱奇艺创维开展战略合作,合力布局开放娱乐生态", 99 | "content": "爱奇艺和创维分别作为国内领先的在线视频品牌", 100 | "imgSrc": "https://i.loli.net/2019/10/21/pPYoLamXQBgM5J2.png", 101 | "reading": 96, 102 | "detail": "爱奇艺和创维分别作为国内领先的在线视频品牌和家电品牌。双方一直锐意创新,为用户提供优质的服务体验和产品体验。据悉,爱奇艺与创维将展开从资本到VIP会员服务等各方面的深入合作。籍由此次合作,爱奇艺将战略投资创维旗下拥有高端互联网电视品牌的酷开公司。从下一财年开始,创维旗下互联网电视将通过银河互联网电视集成播控平台,预置VIP会员服务及相关内容。这种捆绑终端与VIP内容的全新销售模式,将大幅提升互联网电视终端用户的体验,给予用户更多优质内容的选择。", 103 | collection: 26, 104 | dateTime: "21小时前", 105 | "headimgSrc": "https://i.loli.net/2019/10/21/pPYoLamXQBgM5J2.png", 106 | author: "深白色", 107 | date: "Nov 20 2016", 108 | avatar: "https://i.loli.net/2019/10/21/69uRNBXwaZMUOWo.png", 109 | postId: 5, 110 | music: { 111 | url: "http://music.163.com/song/media/outer/url?id=186240", 112 | "title": "朋友-谭咏麟", 113 | coverImg: "http://p4.music.126.net/9PrJFGyL4jvNEQ1vFjMzzA==/3442570914300329.jpg" 114 | } 115 | }, 116 | ] -------------------------------------------------------------------------------- /vue/vue-day13/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-day13", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.19.0", 12 | "babel-plugin-import": "^1.12.2", 13 | "core-js": "^3.3.2", 14 | "vant": "^2.2.13", 15 | "vue": "^2.6.10", 16 | "vue-router": "^3.1.3", 17 | "vuex": "^3.0.1" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "^4.0.0", 21 | "@vue/cli-plugin-eslint": "^4.0.0", 22 | "@vue/cli-plugin-router": "^4.0.0", 23 | "@vue/cli-plugin-vuex": "^4.0.0", 24 | "@vue/cli-service": "^4.0.0", 25 | "babel-eslint": "^10.0.3", 26 | "eslint": "^5.16.0", 27 | "eslint-plugin-vue": "^5.0.0", 28 | "node-sass": "^4.12.0", 29 | "sass-loader": "^8.0.0", 30 | "vue-template-compiler": "^2.6.10" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vue/vue-day13/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vue/vue-day13/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day13/public/favicon.ico -------------------------------------------------------------------------------- /vue/vue-day13/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | vue-day13 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /vue/vue-day13/src/App.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 33 | -------------------------------------------------------------------------------- /vue/vue-day13/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/vue/vue-day13/src/assets/logo.png -------------------------------------------------------------------------------- /vue/vue-day13/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import axios from 'axios' 6 | Vue.config.productionTip = false 7 | Vue.prototype.axios=axios 8 | new Vue({ 9 | router, 10 | store, 11 | render: h => h(App) 12 | }).$mount('#app') 13 | -------------------------------------------------------------------------------- /vue/vue-day13/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Home from '../views/Home.vue' 4 | 5 | Vue.use(VueRouter) 6 | 7 | const routes = [ 8 | { 9 | path: '/', 10 | name: 'home', 11 | component: Home 12 | }, 13 | { 14 | path: '/about', 15 | name: 'about', 16 | component: () => import('../views/About.vue') 17 | } 18 | ] 19 | 20 | const router = new VueRouter({ 21 | mode: 'history', 22 | base: process.env.BASE_URL, 23 | routes 24 | }) 25 | 26 | export default router 27 | -------------------------------------------------------------------------------- /vue/vue-day13/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import user from './modules/user' 4 | import info from './modules/info' 5 | Vue.use(Vuex) 6 | 7 | export default new Vuex.Store({ 8 | modules:{ 9 | user, 10 | info 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /vue/vue-day13/src/store/modules/info.js: -------------------------------------------------------------------------------- 1 | const info={ 2 | state:{ 3 | tips:12, 4 | news:15 5 | }, 6 | mutations:{ 7 | add(state){ 8 | state.tips++ 9 | }, 10 | reduce(state){ 11 | state.tips-- 12 | } 13 | }, 14 | actions:{ 15 | myAdd(ctx){ 16 | ctx.commit("add") 17 | }, 18 | myReduce(ctx){ 19 | ctx.commit("reduce") 20 | } 21 | }, 22 | getters:{} 23 | } 24 | export default info -------------------------------------------------------------------------------- /vue/vue-day13/src/store/modules/user.js: -------------------------------------------------------------------------------- 1 | const user={ 2 | state:{ 3 | name:"张三" 4 | }, 5 | mutations:{}, 6 | actions:{}, 7 | getters:{} 8 | } 9 | export default user -------------------------------------------------------------------------------- /vue/vue-day13/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | 21 | -------------------------------------------------------------------------------- /vue/vue-day13/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 27 | -------------------------------------------------------------------------------- /vue/vue-day13/src/views/data.js: -------------------------------------------------------------------------------- 1 | var a=10; 2 | var b=20; 3 | // export default { 4 | // a, 5 | // b 6 | // } 7 | export {a,b} -------------------------------------------------------------------------------- /webpack/artists/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /webpack/artists/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "top250", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.js", 8 | "serve": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.19.0", 15 | "axios-jsonp-pro": "^1.1.6", 16 | "clean-webpack-plugin": "^3.0.0", 17 | "cross-env": "^6.0.3", 18 | "css-loader": "^3.2.0", 19 | "file-loader": "^4.2.0", 20 | "html-webpack-plugin": "^3.2.0", 21 | "style-loader": "^1.0.0", 22 | "vue": "^2.6.10", 23 | "vue-loader": "^15.7.1", 24 | "vue-template-compiler": "^2.6.10", 25 | "webpack": "^4.41.2", 26 | "webpack-cli": "^3.3.10", 27 | "webpack-dev-server": "^3.9.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /webpack/artists/src/App.vue: -------------------------------------------------------------------------------- 1 | 16 | 33 | -------------------------------------------------------------------------------- /webpack/artists/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue'; 3 | const root = document.createElement("div"); 4 | document.body.append(root) 5 | new Vue({ 6 | render:h=>h(App) 7 | }).$mount(root) -------------------------------------------------------------------------------- /webpack/artists/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 4 | const isDev = process.env.NODE_ENV == 'development' 5 | const {VueLoaderPlugin} = require('vue-loader'); 6 | const config = { 7 | entry: path.join(__dirname, 'src/index.js'), //要打包的文件 8 | output: { 9 | /* 打包成的文件名 */ 10 | filename: "bundle.js", 11 | /* 打包的目录 */ 12 | path: path.join(__dirname, 'dist') 13 | }, 14 | plugins: [ 15 | new HtmlWebpackPlugin({ 16 | title: "webpack测试" 17 | }), 18 | new CleanWebpackPlugin(), 19 | new VueLoaderPlugin() 20 | ], 21 | module:{ 22 | rules:[ 23 | { 24 | test:/\.css$/, 25 | use:[ 26 | 'style-loader', 27 | 'css-loader' 28 | ] 29 | }, 30 | { 31 | test:/\.vue$/, 32 | use:'vue-loader' 33 | }, 34 | { 35 | test:/\.png|jpg|gif$/i, 36 | use:'file-loader' 37 | } 38 | ] 39 | }, 40 | mode: "development" 41 | } 42 | if(isDev){ 43 | config.devServer ={ 44 | host:'localhost', 45 | port:8080, 46 | /* 错误是否显示在界面上 */ 47 | overlay:{ 48 | errors:true 49 | }, 50 | /* 是否进行热更新 */ 51 | hot:true 52 | } 53 | } 54 | module.exports = config -------------------------------------------------------------------------------- /webpack/cat/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /webpack/cat/assets/index.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/webpack/cat/assets/index.css -------------------------------------------------------------------------------- /webpack/cat/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "01demo", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.js", 8 | "serve": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.19.0", 15 | "clean-webpack-plugin": "^3.0.0", 16 | "cross-env": "^6.0.3", 17 | "css-loader": "^3.2.0", 18 | "file-loader": "^4.2.0", 19 | "html-webpack-plugin": "^3.2.0", 20 | "style-loader": "^1.0.0", 21 | "vue": "^2.6.10", 22 | "vue-loader": "^15.7.1", 23 | "vue-template-compiler": "^2.6.10", 24 | "webpack": "^4.41.2", 25 | "webpack-cli": "^3.3.9", 26 | "webpack-dev-server": "^3.8.2" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /webpack/cat/src/App.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 44 | -------------------------------------------------------------------------------- /webpack/cat/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import '../assets/index.css' 3 | import App from './App.vue' 4 | const root=document.createElement("div") 5 | document.body.append(root) 6 | new Vue({ 7 | render:h=>h(App) 8 | }).$mount(root) -------------------------------------------------------------------------------- /webpack/cat/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path=require('path') 2 | const HtmlWebpackPlugin=require('html-webpack-plugin') 3 | const {CleanWebpackPlugin}=require('clean-webpack-plugin') 4 | const isDev=process.env.NODE_ENV=='development' 5 | const {VueLoaderPlugin} = require('vue-loader'); 6 | const config={ 7 | entry:path.join(__dirname,'src/index.js'), 8 | output:{ 9 | filename:"bundle.js", 10 | path:path.join(__dirname,'dist') 11 | }, 12 | plugins:[ 13 | new HtmlWebpackPlugin({ 14 | title:"webpack测试" 15 | }), 16 | new CleanWebpackPlugin(), 17 | new VueLoaderPlugin() 18 | ], 19 | module:{ 20 | rules:[ 21 | { 22 | test:/\.css$/, 23 | use:[ 24 | 'style-loader', 25 | 'css-loader' 26 | ] 27 | }, 28 | { 29 | test:/\.vue$/, 30 | use:'vue-loader' 31 | }, 32 | { 33 | test:/\.png|jpg|gif$/i, 34 | use:'file-loader' 35 | } 36 | ] 37 | }, 38 | mode:"development" 39 | } 40 | if(isDev){ 41 | config.devServer={ 42 | host:'localhost', 43 | port:8080, 44 | overlay:{ 45 | errors:true 46 | }, 47 | hot:true 48 | } 49 | } 50 | module.exports=config -------------------------------------------------------------------------------- /webpack/newAlbum/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /webpack/newAlbum/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "top250", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.js", 8 | "serve": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.19.0", 15 | "axios-jsonp-pro": "^1.1.6", 16 | "clean-webpack-plugin": "^3.0.0", 17 | "cross-env": "^6.0.3", 18 | "css-loader": "^3.2.0", 19 | "file-loader": "^4.2.0", 20 | "html-webpack-plugin": "^3.2.0", 21 | "style-loader": "^1.0.0", 22 | "vue": "^2.6.10", 23 | "vue-loader": "^15.7.1", 24 | "vue-template-compiler": "^2.6.10", 25 | "webpack": "^4.41.2", 26 | "webpack-cli": "^3.3.10", 27 | "webpack-dev-server": "^3.9.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /webpack/newAlbum/src/App.vue: -------------------------------------------------------------------------------- 1 | 28 | 45 | -------------------------------------------------------------------------------- /webpack/newAlbum/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue'; 3 | const root = document.createElement("div"); 4 | document.body.append(root) 5 | new Vue({ 6 | render:h=>h(App) 7 | }).$mount(root) -------------------------------------------------------------------------------- /webpack/newAlbum/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 4 | const isDev = process.env.NODE_ENV == 'development' 5 | const {VueLoaderPlugin} = require('vue-loader'); 6 | const config = { 7 | entry: path.join(__dirname, 'src/index.js'), //要打包的文件 8 | output: { 9 | /* 打包成的文件名 */ 10 | filename: "bundle.js", 11 | /* 打包的目录 */ 12 | path: path.join(__dirname, 'dist') 13 | }, 14 | plugins: [ 15 | new HtmlWebpackPlugin({ 16 | title: "webpack测试" 17 | }), 18 | new CleanWebpackPlugin(), 19 | new VueLoaderPlugin() 20 | ], 21 | module:{ 22 | rules:[ 23 | { 24 | test:/\.css$/, 25 | use:[ 26 | 'style-loader', 27 | 'css-loader' 28 | ] 29 | }, 30 | { 31 | test:/\.vue$/, 32 | use:'vue-loader' 33 | }, 34 | { 35 | test:/\.png|jpg|gif$/i, 36 | use:'file-loader' 37 | } 38 | ] 39 | }, 40 | mode: "development" 41 | } 42 | if(isDev){ 43 | config.devServer ={ 44 | host:'localhost', 45 | port:8080, 46 | /* 错误是否显示在界面上 */ 47 | overlay:{ 48 | errors:true 49 | }, 50 | /* 是否进行热更新 */ 51 | hot:true 52 | } 53 | } 54 | module.exports = config -------------------------------------------------------------------------------- /webpack/radio/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /webpack/radio/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "radio", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.js", 8 | "serve": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.19.0", 15 | "clean-webpack-plugin": "^3.0.0", 16 | "cross-env": "^6.0.3", 17 | "css-loader": "^3.2.0", 18 | "file-loader": "^4.2.0", 19 | "html-webpack-plugin": "^3.2.0", 20 | "style-loader": "^1.0.0", 21 | "vue": "^2.6.10", 22 | "vue-loader": "^15.7.1", 23 | "vue-template-compiler": "^2.6.10", 24 | "webpack": "^4.41.2", 25 | "webpack-cli": "^3.3.10", 26 | "webpack-dev-server": "^3.8.2" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /webpack/radio/src/App.vue: -------------------------------------------------------------------------------- 1 | 21 | 38 | -------------------------------------------------------------------------------- /webpack/radio/src/components/Item.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webpack/radio/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue'; 3 | const root = document.createElement("div"); 4 | document.body.append(root) 5 | new Vue({ 6 | render:h=>h(App) 7 | }).$mount(root) -------------------------------------------------------------------------------- /webpack/radio/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path=require('path') 2 | const HtmlWebpackPlugin=require('html-webpack-plugin') 3 | const {CleanWebpackPlugin}=require('clean-webpack-plugin') 4 | const isDev = process.env.NODE_ENV == 'development' 5 | const {VueLoaderPlugin}=require('vue-loader') 6 | const config={ 7 | entry:path.join(__dirname,'src/index.js'), 8 | output:{ 9 | filename:"bundle.js", 10 | path:path.join(__dirname,'dist') 11 | }, 12 | plugins:[ 13 | new HtmlWebpackPlugin({ 14 | title:"webpack测试" 15 | }), 16 | new CleanWebpackPlugin(), 17 | new VueLoaderPlugin() 18 | ], 19 | module:{ 20 | rules:[ 21 | { 22 | test:/\.css$/, 23 | use:[ 24 | 'style-loader', 25 | 'css-loader' 26 | ] 27 | }, 28 | { 29 | test:/\.vue$/, 30 | use:'vue-loader' 31 | }, 32 | { 33 | test:/\.png|jpg|gif$/i, 34 | use:'file-loader' 35 | } 36 | ] 37 | }, 38 | mode:"development" 39 | } 40 | if(isDev){ 41 | config.devServer ={ 42 | host:'localhost', 43 | port:8080, 44 | /* 错误是否显示在界面上 */ 45 | overlay:{ 46 | errors:true 47 | }, 48 | /* 是否进行热更新 */ 49 | hot:true 50 | } 51 | } 52 | module.exports=config -------------------------------------------------------------------------------- /web配置/web-pack/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /web配置/web-pack/assets/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/web配置/web-pack/assets/01.png -------------------------------------------------------------------------------- /web配置/web-pack/assets/index.css: -------------------------------------------------------------------------------- 1 | *{margin:0;padding:0} 2 | body{ 3 | background: #eee 4 | } -------------------------------------------------------------------------------- /web配置/web-pack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-pack", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "cross-env NODE_ENV=production webpack --config webpack.config.js", 8 | "serve": "cross-env NODE_ENV=development webpack-dev-server --config webpack.config.js" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^0.19.0", 15 | "clean-webpack-plugin": "^3.0.0", 16 | "cross-env": "^6.0.3", 17 | "css-loader": "^3.2.0", 18 | "file-loader": "^4.2.0", 19 | "html-webpack-plugin": "^3.2.0", 20 | "style-loader": "^1.0.0", 21 | "vue": "^2.6.10", 22 | "vue-loader": "^15.7.1", 23 | "vue-template-compiler": "^2.6.10", 24 | "webpack": "^4.41.0", 25 | "webpack-cli": "^3.3.9", 26 | "webpack-dev-server": "^3.8.2" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /web配置/web-pack/src/App.vue: -------------------------------------------------------------------------------- 1 | 9 | 29 | -------------------------------------------------------------------------------- /web配置/web-pack/src/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import '../assets/index.css' 3 | import App from './App.vue' 4 | import axios from 'axios'; 5 | const root = document.createElement("div"); 6 | Vue.prototype.axios=axios 7 | document.body.append(root); 8 | new Vue({ 9 | render:h=>h(App) 10 | }).$mount(root) -------------------------------------------------------------------------------- /web配置/web-pack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path=require("path") 2 | const HtmlWebpackPlugin=require('html-webpack-plugin') 3 | const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 4 | const {VueLoaderPlugin} = require('vue-loader'); 5 | const isDev = process.env.NODE_ENV ==='development' 6 | const config={ 7 | entry:path.join(__dirname,'src/index.js'), 8 | output:{ 9 | /* 打包的文件名 */ 10 | filename:"[hash]-[name]-bundle.js", 11 | /* 打包文件的输出目录 */ 12 | path:path.join(__dirname,'dist') 13 | }, 14 | plugins:[ 15 | new HtmlWebpackPlugin({ 16 | title:"webpack打包" 17 | }), 18 | new CleanWebpackPlugin(), 19 | new VueLoaderPlugin() 20 | ], 21 | module:{ 22 | rules:[ 23 | { 24 | test:/\.css$/, 25 | use:[ 26 | 'style-loader', 27 | 'css-loader' 28 | ] 29 | },{ 30 | test:/\.vue$/, 31 | use:'vue-loader' 32 | },{ 33 | test:/\.png|jpg|gif$/i, 34 | use:"file-loader" 35 | } 36 | ] 37 | }, 38 | mode:"development" 39 | } 40 | if(isDev){ 41 | config.devServer = { 42 | port:8080, 43 | host:'localhost', 44 | overlay:{ 45 | errors:true 46 | }, 47 | hot:true 48 | } 49 | } 50 | module.exports = config -------------------------------------------------------------------------------- /web配置/web-yarn/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /web配置/web-yarn/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wangyuhuan1/vue-notebook/a2bd231c17e324e371ab5c6048aa55f8e2fb3b2c/web配置/web-yarn/index.js -------------------------------------------------------------------------------- /web配置/web-yarn/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "web-yarn", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "dependencies": { 7 | "nodemon": "^1.19.3", 8 | "webpack": "^4.41.0", 9 | "webpack-cli": "^3.3.9" 10 | }, 11 | "scripts":{ 12 | "start":"nodemon index.js" 13 | } 14 | } 15 | --------------------------------------------------------------------------------