vue组件
作者:互联网
1.自定义jiyong组件
<div id="app">
<jiyong v-for="item in items" v-bind:ji="item"></jiyong>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script>
//定义一个vue组件
Vue.component("jiyong",{
props: ['ji'],
template: '<li>{{ji}}</li>'
});
var vm = new Vue({
el:"#app",
data: {
items:["java","前端","python"]
}
});
</script>
标签:vue,自定义,Vue,ji,组件,jiyong 来源: https://www.cnblogs.com/tdtl/p/14405465.html