Vue-cli 用自定义的组件有遇到过哪些问题?

  1. 在 components 目录新建你的组件文件(indexPage.vue), script 一定要 export default {}

  2. 在需要用的页面(组件)中导入:import indexPage from '@/components/indexPage.vue'

  3. 注入到 vue 的子组件的components 属性上面,components:

  4. 在 template 视图 view 中使用,例如命名为 indexPage,使用的时候则是 index-page

posted @ 2023-11-15 10:12  煜火  阅读(16)  评论(0)    收藏  举报