GithubHelp home page GithubHelp logo

vue-toast's Introduction

vue-toast

a modified version from vue-easytoast

Install

npm install vue-toast5 -S

yarn add vue-toast5

QuickStart

require('vue-toast5/dist/vue-toast.css');

// in ES6 modules
import toast from 'vue-toast5';

// in CommonJS
const toast = require('vue-toast5');

// in Global variable
const toast = VueToast.default;

Vue.use(toast);
this.$toast('toast-无参数');
this.$toast('toast-对象参数',{duration:2000});
Vue.toast('toast-回调函数',function(){
    alert('回调函数');
});

Params

Parameter Type Default Description
id string the toast's id
msg string the message showed in toast
callback function the callback function after toast hide
parent string body the parent element to insert toast element
className string, array a custom class for toast
horizontalPosition string center Position horizontal of toast. There are 3 pre-defined positions: center,left,right
verticalPosition string middle Position vertical of toast. There are 3 pre-defined positions: middle,top,bottom
duration number 2000 how long time the toast show,unit is milliscond
mode string override override or queue. If override, the last toast will forcibly flush previous
transition string fade Built-in transitions: fade, slide-[up/down/left/right]. See also Transitions

methods

  • Vue.clearToast([id]):remove all toast or special toast by id

Preview

toast image

vue-toast's People

Contributors

ygtzz avatar

Watchers

 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.