1👍
✅
So long story short I’ve done it by creating a few utility functions that will wrap the pinia store actions.
const setCurrentItemWithConfirm = (status) => {
if (!confirm(t('alerts.confirm_dirty_collection'))) { return; }
return store.setCurrentItem(status);
}
I’ve followed the guides to move Pinia & i18n outside components and things looks good:
- https://pinia.vuejs.org/core-concepts/outside-component-usage.html
- https://vue-i18n.intlify.dev/api/general.html#global
So… yay?
Source:stackexchange.com