Code Monkey home page Code Monkey logo

muse-ui-modal's Introduction

Muse-UI-Toast

Muse-UI plugin toast

travis ci badge Downloads Downloads

Installation

npm install muse-ui-toast -S
// or
yarn add muse-ui-toast

CDN

<link rel="stylesheet" href="https://unpkg.com/muse-ui-loading/dist/muse-ui-toast.all.css"/>
<script src="https://unpkg.com/muse-ui-toast/dist/muse-ui-toast.js"></script>

Usage

import Vue from 'vue'
import MuseUIToast from 'muse-ui-toast';

Vue.use(MuseUIToast);

new Vue({
  methods: {
    toast () {
      this.$toast.message('hello world');
      this.$toast.success('hello world');
      this.$toast.info('hello world');
      this.$toast.warning('hello world');
      this.$toast.error('hello world');
    }
  }
});

// Or
MuseUIToast.message('hello world');
MuseUIToast.success('hello world');
MuseUIToast.info('hello world');
MuseUIToast.warning('hello world');
MuseUIToast.error('hello world');

API

config

Vue.use(MuseUIToast, config) change default config

export default {
  position: 'bottom',               // position
  time: 2000,                       // show time length
  closeIcon: 'close',               // close icon
  close: true,                      // show close button
  successIcon: 'check_circle',      // success icon
  infoIcon: 'info',                 // info icon
  warningIcon: 'priority_high',     // warning icon
  errorIcon: 'warning'              // error icon
};

config (config)

Change default config, Will return new config;

message(options<String/Object>)

Show default message, Will return id;

success(options<String/Object>)

Show default success message, Will return id;

info(options<String/Object>)

Show default info message, Will return id;

error(options<String/Object>)

Show default error message, Will return id;

warning(options<String/Object>)

Show default warning message, Will return id;

options

Name Description Type Accepted Values Default
message show message content String
time show time length Number 2000
position show position String top / top-start / top-end / bottom / bottom-start / bottom-end bottom
close Whether the show close button Boolean true
icon left icon String
actions action buttons, Array, [{ action: '', click: (id) => {} }]
color color String
textColor message text color String

close (id)

close message

Dependencies Muse-UI Components

  • mu-snackbar
  • mu-button
  • mu-icon

Licence

muse-ui-toast is open source and released under the MIT Licence.

Copyright (c) 2018 myron

muse-ui-modal's People

Contributors

myronliu347 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.