A Vue.js project
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
For a detailed explanation on how things work, check out the guide and docs for vue-loader.
-chap2/2-2.html
-chap2/2-3.html
-chap2/2-4.html
- chap3/3-2.html
- chap3/3-3.html
- chap3/3-4.html
- chap3/3-5.html
- chap3/3-6.html
-
chap3/3-7.html
-
v-if, v-show
-
input define key
- chap3/3-8.html
-
chap4/4-1.html
-
is: 解决H5上的小bug
-
data must function
-
ref
-
chap4/4-2.html
-
单项数据流
-
$emit
-
child component data must function
- chap4/4-3.html
- chap4/4-4.html
-
chap4/4-5.html
-
bus
- chap4/4-6.html
- chap4/4-7.html
-
chap4/4-8.html
-
动态组件
-
v-once
- chap5/5-1.html
- chap5/5-2.html
- Animate.css library
- chap5/5-3.html
- chap5/5-4.html
- Velocity.js library
- chap5/5-5.html
- key
- mode
- 动态组件
- chap5/5-6.html
- chap5/5-7.html
node -v
npm -v
vue init webpack imooc-travel
npm run dev
- router/route.js
- static/know1.png
- static/know2.png
- index.html/meta
- iconfont
- reset.css
- border.css
- fastclick 移动端延迟300ms解决
npm install fastclick
- home/Header.vue
- 1rem = html font-size=50px
npm install stylus --save
npm install stylus-loader --save
- home/Header.vue
- 别名配置 webpack.base.conf.js
- home/Swiper.vue
- prevent shake, inside css .wrapper
- vue-awesome-swiper
- 图片宽高比固定比值 Swpier.styl
-
: 样式穿透
npm install vue-awesome-swiper --save
- home/Icons.vue
- home/Icons.vue
- swiper 无法分页, 解决
- swiper 样式设置
- css 显示...
- home/Recommend.vue
- home/Weekend.vue
- Weekend.styl 固定宽高比
- home/Home.vue
- axios 异步传数据
npm install axios --save
- 转发访问的路径内容
- config/index.js
proxyTable: {
'/api': {
target: 'http://localhost:8080',
pathRewrite: {
'^/api': '/static/mock'
}
}
},
axios.get('/api/index.json?city=')
将转发到
axios.get('/static/mock/index.json?city=' + this.city)
- home/Home.vue
- home/Header.vue
- home/Icons.vue
- home/Recommend.vue
- home/Swiper.vue
- home/Weekend.vue
- city/Header.vue
- city/Search.vue
- city/List.vue
-
city/Search.vue
-
city/Alphabet.vue
-
better-scroll
-
city/City.vue
-
city/List.vue
-
Ajax
- city/Alphabet.vue
- city/City.vue
- city/List.vue
-
city/Alphabet.vue
-
Performance optimization
-
Throttling function
- city/Search.vue
- better-scroll
(city/List.vue) (city/Search.vue) (home/Header.vue) (store/state.js) (store/store.js) (store/mutations.js)
- ✨✨✨✨
npm install vuex --save
(App.vue) (Home.vue)
- ✨✨✨✨
(Banner.vue)
- ✨✨
(Gallary.vue)
- ✨✨✨
(Header.vue)
- ✨✨✨
(Header.vue)
- ✨✨✨
(List.vue)
- ✨✨✨
// name use for Recursive
name: 'DetailList',
(Detail.vue) (route.js)
- ✨✨✨
(FadeAnimation.vue) (Banner.vue)
- ✨✨
(config/index.js)
- ✨✨
(config/index.js) (package.json) (city/Alphabet.vue)
- ✨✨✨
ifconfig
inet: IP (package.json)
"dev": "webpack-dev-server --host 0.0.0.0 --inline --progress --config build/webpack.dev.conf.js",
IP:8080
IP:8080
(city/Alphabet.vue)
fix bug
when your mobile too low, add some promise grammar
(config/index.js)
- ✨✨✨
npm run build
(config/index.js)
App put into project file, need to config path, Back-end access project file can run App
build: {
assetsPublicPath: '/project',
}
- ✨