vue
LitStronger
from HDU
个人博客: https://litstronger.github.io
或者https://litstrong.gitee.io
展开
-
vue-cli4.0引入router报错Error in render: “TypeError: Cannot read property ‘matched‘ of undefined“
报错如下属性matched未定义,估计是vue-router模块没有正常引入。排查后发现了问题:Vue加载vue-router需要需要的属性名是router,且是固定的。而我用了简写的方式导致属性名对应不上(简写Router等价于Router:Router)解决办法如下或者直接在引入时就把路由命名为routerimport router from './router/index' ......new Vue({ router, render: h => h(App),})原创 2020-08-30 10:42:07 · 518 阅读 · 0 评论 -
vue-cli4.0引入官方文档Layout示例过程(按需引入)
写在前面:建议在了解了如何按需引入一个简单的按钮后再看本篇。常见报错[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the “name” option.[Vue warn]: Unknown custom element: - did you register the component .原创 2020-08-30 00:48:40 · 3369 阅读 · 0 评论 -
vue-cli3添加组件流程(新手向)
一、流程结构在添加组件前呢,先了解一下vue项目的运行流程。整个项目的入口是main.js,在开头就引入了vue源码和主页面App.vue。之后是生成一个Vue实例,把App.vue的内容渲染到浏览器上新建组件为新建的vue项目添加组件,一半是放在文件夹components下,然后在App.vue(或者其他你想引入组件的地方)导入组件新建组件list<templa...原创 2020-04-14 20:44:52 · 1268 阅读 · 0 评论