<code> <p id=
"box6"
>
<my-component2 :showInfor=
"hello"
></my-component2>
<my-component2 :showInfor=
"hi"
></my-component2>
</p>
<script type=
"text/javascript"
>
Vue.component(
'my-component2'
,{
props: [
'showInfor'
],
template:
"<p><h4>{{showInfor}}</h4></p>"
,
computed: {
showInforRes:
function
(){
return
this.showInfor+
" world!"
}
}
})
var
com2 =
new
Vue({
el:
'#box6'
})
</script>
</code>