@lipn/snackbar-message

2.0.0 • Public • Published

Snackbar Message

Vuetify component that shows a message in a snackbar.

Dependencies

Install

npm install @lipn/snackbar-message

Use

  1. First of all, import the plugin.
import Vue from 'vue';
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
import SnackbarMessage from '@lipn/snackbar-message';

Vue.use(Vuetify);
Vue.use(SnackbarMessage);

new Vue({
  el: '#app',
  vuetify: new Vuetify(),
  // Global access to the dialog via $root.$snackbar
  mounted() {
    this.$root.$snackbar = this.$refs.snackbar;
  },
  methods: {
    async save() {
      console.log('saving');
      this.$root.$snackbar.show('Success', {
        color: 'warning', multiline: false, timeout: 4000,
        close: { text: 'OK', color: 'black' }
      });
    }
};
  1. Insert component where you want to use it:
<html>
<body>
  <div id="app">
    <v-app>
      <v-container>
        <!-- snackbar -->
        <snackbar-message ref="snackbar"></snackbar-message>
        <!-- rest of the code -->
      </v-container>
    </v-app>
  </div>
</html>

Showcase

Showcase

Readme

Keywords

none

Package Sidebar

Install

npm i @lipn/snackbar-message

Weekly Downloads

0

Version

2.0.0

License

GPL-3.0

Unpacked Size

195 kB

Total Files

10

Last publish

Collaborators

  • himito