Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vuex-toast
Advanced tools
Readme
Simple toast notification using Vuex
http://codepen.io/ktsn/pen/Bzxkjd
First, you should register a toast module to your Vuex store. You can use a default style at dist/vuex-toast.css
.
import Vue from 'vue'
import Vuex from 'vuex'
import { createModule } from 'vuex-toast'
// If you want to use the default style (with webpack css-loader)
import 'vuex-toast/dist/vuex-toast.css'
Vue.use(Vuex)
export default new Vuex.Store({
modules: {
// ...
toast: createModule({
dismissInterval: 8000
})
// ...
}
})
Put Toast
component anywhere in your application.
<template>
<div>
<article><!-- Your contents --></article>
<toast position="ne"></toast>
</div>
</template>
<script>
import { Toast } from 'vuex-toast'
export default {
// ...
components: {
Toast
}
// ...
}
</script>
You can send notifications to the toast component with toast type.
import { mapActions } from 'vuex'
import { ADD_TOAST_MESSAGE } from 'vuex-toast'
export default {
methods: {
...mapActions({
addToast: ADD_TOAST_MESSAGE
}),
sendNotification(text) {
this.addToast({
text,
type: 'success',
dismissAfter: 10000
})
}
}
}
Toast
A Vue component that shows toast messages.
position
html
namespace
createModule(options): VuexModule
Create Vuex module for managing toast messages.
createComponent(options): VueComponent
Create customized toast component.
dispatch(ADD_TOAST_MESSAGE, { text, type, dismissAfter })
dispatch(REMOVE_TOAST_MESSAGE, messageId)
id
Auto generated message IDtext
Text of the toast messagetype
Type of the toast message
info
, success
, warning
, and danger
dismissAfter
Milli-second that indicates the message dismiss after this timeMIT
FAQs
Simple toast notification using Vuex
The npm package vuex-toast receives a total of 591 weekly downloads. As such, vuex-toast popularity was classified as not popular.
We found that vuex-toast demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.