vue简单的局部组件案例component template

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>vue简单的局部组件案例component template</title>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>

<body>
<div id="app">
<assembly></assembly>
</div>

<script type="text/javascript">
var Child={
template:"<div>前端菜鸟组件!</div>"
};

new Vue({
el:"#app",
components:{
"assembly":Child
}
})

</script>
</body>
</html>

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: