docs_vue2/one/docs/demo/toast/plugin.vue
2021-09-15 20:03:51 +08:00

42 lines
772 B
Vue

<template>
<article>
<veui-button
@click="$toast.info({
message: 'Press any key to continue...',
duration: 5000
})"
>
Info
</veui-button>
<veui-button @click="$toast.success('Your profile has been updated.')">
Success
</veui-button>
<veui-button @click="$toast.warn('v1 is deprecated. Use v2 instead.')">
Warn
</veui-button>
<veui-button @click="$toast.error('Uncaught SyntaxError: Unexpected token +')">
Error
</veui-button>
</article>
</template>
<script>
import Vue from 'vue'
import { Button } from 'veui'
import toast from 'veui/plugins/toast'
Vue.use(toast)
export default {
components: {
'veui-button': Button
}
}
</script>
<style lang="less" scoped>
.veui-button {
margin-right: 20px;
}
</style>