1.0.6 • Published 6 years ago

nice-toast v1.0.6

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

nice-toast


Intro

nice-toast is a vue plugin which based on vue.js.

Usage

# NPM Download
npm install nice-toast --save

1. import nice-toast globally in main.js.

import Vue from 'vue'
import NiceToast from 'nice-toast'
import 'nice-toast/lib/assets/css/toast.css'
Vue.use(NiceToast, {
    // your options
})

2. use nice-toast in component.

<script>
    export default {
        data () {
            return {
                ...
            }
        },
        methods: {
            clickMethod: function (index) {
                // passing into the parameters
                this.$toast('toast', 'bottom')
                // complete example
                this.$toast('tips', 'position', 'duration', 'shape', 'color')
                this.$loading('loading', 'show')
                this.$loading('loading', 'hide')
            }
        }
    }
</script>

Basic API (Customized)

1. Global Config in main.js

    const options = {
        position: 'bottom',
        duration: '2000',
        shape: 'rect',
        direction: 'up',
        color: 'deep',
        loading: 1
    }
    Vue.use(toast, options)

2. Configs description

ConfigsTypesDefaultDescription
positionstringbottomthe position of toast. top, center, bottom.
durationnumber2000the duration time of toast.
shapestringrectthe shape time of toast. rect, circle.
directionstringupthe move direction while toast show. up, down.
colorstringdeepthe color of toast and text in it. light, deep.
loadingnumber1the loading icon of the loading tip. 1, 2, 3, 4.

License

MIT

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago