vc-alert

Install

npm install vc-alert --save
// build version
import vcAlert from 'vc-alert'
// recommend for *.vue project for small bundle size
import vcAlert from 'vc-alert/src/Alert.vue'
// commonjs
require('./dist/build.min.js')
// script tag
<script src='./dist/build.min.js'></script>

Usage

props

type

type of alert

mode

是否固定文档流

dismissable

是否有关闭按钮

show

是否显示

duration

可选的持续时间

width

宽度

placement

定位

positionClass

example

import Vue from 'vue'
import vcAlert from '../src'
new Vue({
el: '#app',
data () {
return {
bools: {
'true': true,
'false': false
},
show: false,
mode: 'fixed',
type: 'success',
width: '500',
placement: 'top',
duration: '3000',
dismissable: true,
positionClass: null
}
},
components: {
vcAlert
}
}
<vc-alert
:show.sync="show"
:mode="mode"
:placement="placement"
:duration="duration"
:type="type"
:width="width"
:position-class="positionClass"
:dismissable="dismissable"
>
<span class="icon-ok-circled alert-icon-float-left"></span>
<strong>Well Done!</strong>
<p>You successfully read this important alert message.</p>
</vc-alert>