<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>组件基础</title>
</head>
<body>
<div id="app">
<greeting to="mike">Hello,</greeting>
<greeting to="jane">Hello,</greeting>
</div>
<script src="../js/vue.js"></script>
<script>
Vue.component('greeting',{
props:['to'],
template:'<div><h1><slot></slot></h1><h2>{{to}}</h2></div>',
});
let vm = new Vue({
el:'#app'
});
/*
template中必须有唯一根元素div,包裹其他元素
*/
</script>
</body>
</html>
vue-前端第9章component07.html
原创
©著作权归作者所有:来自51CTO博客作者虾米大王的原创作品,请联系作者获取转载授权,否则将追究法律责任

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
vue-前端第9章component04.html
【代码】vue-前端第9章component04.html。
vue.js html Vue -
vue-前端第9章component06.html
【代码】vue-前端第9章component06.html。
vue.js html Vue -
vue-前端第9章component01.html
【代码】vue-前端第9章component01.html。
vue.js html Vue -
vue-前端第9章component03.html
【代码】vue-前端第9章component03.html。
vue.js html Vue -
vue-前端第9章component08.html
【代码】vue-前端第9章component08.html。
vue.js javascript 前端 html Vue -
vue-前端第9章component05.html
【代码】vue-前端第9章component05.html。
vue.js javascript 前端 html Vue -
vue-前端第9章component02.html
【代码】vue-前端第9章component02.html。
vue.js javascript 前端 html Vue -
vue-前端第2章instance07.html
【代码】vue-前端第2章instance07.html。
vue.js javascript 前端 html ci -
vue-前端第5章event07.html
【代码】vue-前端第5章event07.html。
javascript html css bc -
vue-前端第3章watch07.html
【代码】vue-前端第3章watch07.html。
vue.js javascript 前端 html 数组 -
vue-前端第4章class07.html
【代码】vue-前端第4章class07.html。
javascript vue.js 前端 html css -
vue-前端第6章form07.html
【代码】vue-前端第6章form07.html。
vue.js javascript 前端 html 复选框 -
vue-前端第7章v-if07.html
【代码】vue-前端第7章v-if07.html。
html css javascript vue.js -
vue-前端第12章transition07.html
【代码】vue-前端第12章transition07.html。
vue.js javascript 前端 html Math -
vue-前端第11章ajax-demo07.html
【代码】vue-前端第11章ajax-demo07.html。
vue.js javascript 前端 html ios -
vue-案例教程第6章07.html
【代码】vue-案例教程第6章07.html。
javascript 前端 vue.js ide html -
vue-案例教程第2章07.html
【代码】vue-案例教程第2章07.html。
javascript 前端 html -
vue-案例教程第3章07.html
【代码】vue-案例教程第3章07.html。
vue.js html i++ javascript -
vue-案例教程第5章07.html
【代码】vue-案例教程第5章07.html。
javascript 前端 vue.js html 整除