0👍
You should create another component, let’s call Togglable
. You can pass the content with props or using slots as shown on the docs here
With the new component you can use it for each li. Check v-for
as well if your data is dynamic too.
It is going to look similar to this:
<togglable content="hello" button-name="Toggle"></togglable>
- [Vuejs]-Vue.js select v-model value not in $(element).val()
- [Vuejs]-Firebase + Vue + Vuex: Keeping The User Logged In
Source:stackexchange.com