vue组件中嵌套html,vue2.0怎么用组件自定义标签实现组件的嵌套?
生活随笔
收集整理的這篇文章主要介紹了
vue组件中嵌套html,vue2.0怎么用组件自定义标签实现组件的嵌套?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
想用這種方式實現組件嵌套:
目前實現的方式:是在app-content.vue中的template中嵌套的
index.html
main.js
import Vue from '../node_modules/vue/dist/vue';
import app from './app.js';
new Vue(app);
app.js
import content from '../components/app-content.vue'
module.exports={
el:"#app",
data:{},
components:{
appContent:content
}
};
app-content.vue
#content{
height: 100vh;
width: 100vw;
background: rgb(240,240,240);
position: relative;
}
import myHeader from './app-top.vue';
import myFooter from './app-bottom.vue';
export default {
components:{
myHeader,
myFooter
}
}
總結
以上是生活随笔為你收集整理的vue组件中嵌套html,vue2.0怎么用组件自定义标签实现组件的嵌套?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: (二叉树DFS)天平UVa 839
- 下一篇: 2018.9.10.Matlab实验一: