vue import组件的使用
生活随笔
收集整理的這篇文章主要介紹了
vue import组件的使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
vue import組件的使用
export default { components: { firstcomponent } }
</script>
1新建/src/component/firstcomponent.vue
<template><div id="firstcomponent"><h1>I am a title.</h1></div> </template>2在app.vue引入組件 并且注冊
<script> import firstcomponent from './component/firstcomponent.vue'export default { components: { firstcomponent } }
</script>
3 在app.vue的在<template></template>內加上<firstcomponent></firstcomponent>
<template><div id="app"><firstcomponent></firstcomponent></div> </template>?
posted on 2017-02-14 01:55 木子煒培先生 閱讀(...) 評論(...) 編輯 收藏轉載于:https://www.cnblogs.com/liadmin/p/6396025.html
總結
以上是生活随笔為你收集整理的vue import组件的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HDU 2112 HDU Today l
- 下一篇: vue 入门环境搭建