记录vue开发项目的一些‘坑’

填坑无处不在

  • 在非主页面或者公共页面的的情况下,样式表中必须加入scoped,如下所示

    1
    <style scoped></style>
  • 所有的指令中无法加入Filter过滤器

  • 非根目录下部署项目需要配置路由

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    const router = new VueRouter({
    mode: 'hash',
    base: '/文件夹路径/',
    routes: routers
    })
    new Vue({
    router: router,
    el: '#app',
    render: h => h(App)
    })