Vue 將一個組件嵌入到另一個組件中


https://github.com/JasmineQian/Vue_Sample

 

App.vue是所有組件的

 

要嵌入到App.vue組件中,

在script處導入

import xxx  from './components/Helloxxx'

 

在export default中加入自己的組件

最后在template處,導入自己的組件即可

 

logo是在app.vue中添加的

籃框是在helloword中添加的,引入到app

紅框是在helloLady中添加的,引入到app

 

 

 

 

 

### Vue內容
##### <!--1 模版: html結構-->
##### <template>
##### <div id="app">
#####
##### </div>
##### </template>


##### <!--2 行為: 處理邏輯-->
##### <script>
##### export default {
#####
##### }
##### </script>


##### <!--3 樣式:解決樣式-->
##### <style>
#####
##### </style>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM