I have defined two different components:
'permissionTitle':customTitle,
'permissionItem':customItem,
When displayed in the main template, they are structured as follows:
<permissionTitle content="Brand Management">
<permissionItem>View List</permissionItem>
<permissionItem>Add</permissionItem>
<permissionItem>Edit</permissionItem>
<permissionItem>Delete</permissionItem>
</permissionTitle>
Now, I am looking to pass values from permissionItem to permissionTitle and vice versa. What is the best way to achieve this?
In permissionTitle.vue:
<template>
<div id="root">
<Checkbox>
<span>{{content}}</span>
</Checkbox>
<slot></slot>
</div>
</template>
In permissionItem.vue:
<template>
<Checkbox @on-change="change">
<slot></slot>
</Checkbox>
</template>