I am following a tutorial on udemy. But instead of using vue 2 and vuex i use vue 3 and pinia. It works almost. One thing i cant seem to fix like the writer does.
I made a child component that has a click event to delete a task in pinia. The thing is
he uses
@click="$store.dispatch('deleteTask', task.id)"
And he states that you dont need to import the vuex store etc in the child component. But when trying to do this with pinia i always get a deleteTask not defined. When importing the store in the child component it works. Is this even possible with pinia? I us:
@click.stop='useTasks.deleteTask(task.id)'
funkyj4ever is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.