<div id="app">
{{message}}
<customize prop="xxx"></customize>
</div>
<script type="text/javascript">
//
var customize = {
//
template: `
{{prop}}
`,
//
// props: ["prop"]
}
var app = new Vue({
el: "-sharpapp",
data: {
message: "{{message}}:hello customize components"
},
components: {
"customize": customize
}
})
</script>
as in the code above, the template will not render the content of {{prop}} because:
/ / props: ["prop"]
and still remain in DOM:
< p prop= "xxx" >
""
props: ["prop"]
DOM:
so what"s the practical point of this? In addition, what should I do if I want to pass a value to the property prop of the component?