Displaying a variable in the default scope - this method is functional.
<slot>{{namedSlotText}}</slot>
However, attempting it in another way results in the variable not being displayed.
Template
<div id="app">
<my-component></my-component>
</div>
Code
let vm = new Vue({
el:"#app",
components:{
myComponent:{
template:`
<div>
<slot :text="namedSlotText"></slot>
</div>
`,
data:()=>({
namedSlotText: "This is default slot text"
})
}
}
})
I have seen instances where v-text
has been successful.