I'm trying to use data variable inside another data variable, but when I console it shows undefined. I'm trying to switch checkbox with setting data value true and false. My code is below,
data() {
return {
roleCreate:true,
rows:[
{
id:1,
type:0,
create: `<label class="switch switch-primary mr-3">
<input type="checkbox" ${this.roleCreate && 'checked'}>
<span class="slider"></span>
</label>`,
}
]
}
}
How can I do this?