1.使用iconfont
直接在main.js中引用iconfont.css
2.vue-awesome-swiper
在swiper中,处理因为使用v-show隐藏后显示轮播宽度或者高度失效,在swiper配置中加入
observeParents: true,
observer: true
3.处理图片或者数据没有加载处理而没有高度的问题
直接设置height:0;使用padding-bottom撑高高度,如:
height: 0
width: 100%
padding-bottom: 100%
4.路由滚动行为设置,每一个页面都从顶部开始
scrollBehavior (to, from, savedPosition) {
return { x: 0, y: 0 }
}
5.使用ip地址访问正在跑的项目,在dev中加入 --host 0.0.0.0
"dev": "webpack-dev-server --host 0.0.0.0 --inline --progress --config build/webpack.dev.conf.js",
6.静态文件的配置,在config的index.js下
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/', //决定了公共文件的路劲,可以更改