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>
上一篇:c语言实现9 9乘法表


下一篇:普通话测试30篇文章,附带拼音