console
Vue.component('blog-post', {
template: `
<div>
<h2>123456</h2>
<slot></slot>
<div>
`,
})
Vue.component('blog-test', {
template: `
props:{
aa: {
default() {
return 'oooo';
},
},
},
<div>
<h2>778899</h2>
<div>
`,
created(){
console.log(this.aa);
}
})
var app = new Vue({
el: '#app',
data: {
color: 'green',
arr:[1,2]
},
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="app">
<blog-post>
<blog-test></blog-test>
</blog-post>
<blog-post>
<blog-test :test='"123"'></blog-test>
</blog-post>
</div>
</body>
</html>