@gits-id/toast-store
v1.0.0-beta.3
Published
Store module for @gits-id/toast.
Downloads
2
Readme
Toast Store
Store module for @gits-id/toast.
Installation
# With NPM
npm i @gits-id/toast
# With Yarn
yarn add @gits-id/toast
# With PNPM
pnpm add @gits-id/toast
Usage
Composition API
import {useToast} from '@gits-id/toast-store'
const toast = useToast()
toast.show()
toast.confirm()
toast.confirmDelete()
Pinia
// file: stores/toast.ts
import {useToastStore} from '@gits-id/toast-store'
const toast = useToastStore()
toast.show()
toast.confirm()
toast.confirmDelete()
Vuex (Recommended)
// file: store/index.ts
import {toastModule} from '@gits-id/toast-store'
export default new Vuex({
modules: {
toast: toastModule
}
})
<script setup>
const store = useStore()
store.toast.show()
store.toast.confirm()
store.toast.confirmDelete()
</script>
License
MIT