-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle dragAndDrop with global state, pinia store or useState nuxt? #38
Comments
I find a dirty solution, to update my pinia store const shopStore = useShops()
const { updateImplementation, loadRack, loadRackForced } = shopStore
const { selectedShop } = storeToRefs(shopStore)
const [
parent,
racks] =
useDragAndDrop(selectedShop.value.implementation, {
draggingClass: 'bg-blue-800 text-white',
handleEnd: ({ targetData }) => {
const newOrderedArrValue = targetData.parent.data.enabledNodes.map(({ data }) => data.value)
selectedShop.value.implementation = newOrderedArrValue
updateImplementation()
},
sortable: true,
});
if it could help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, i'm working with Nuxt 3 and useState in composable called useQuiz, i'm using deep components and i need to work with global state, the quiz variable has the follow structure:
Now i need to pass Quiz.value.questions and also after in another component i need to pass quiz.value.question.options, how can i handle?
I'm trying to to this, but i can't because i need to pass type Ref, but i can't because i lose the reactivity when i add a new item to quiz.questions or when i remove a question.
The text was updated successfully, but these errors were encountered: