support Notice

support Notice
This commit is contained in:
梁灏 2017-03-09 22:32:57 +08:00
parent 6cadeba44f
commit 833501a4fa
7 changed files with 32 additions and 25 deletions

View file

@ -53,6 +53,7 @@ li + li { border-left: solid 1px #bbb; padding-left: 10px; margin-left: 10px; }
<li><router-link to="/loading-bar">LoadingBar</router-link></li>
<li><router-link to="/modal">Modal</router-link></li>
<li><router-link to="/message">Message</router-link></li>
<li><router-link to="/notice">Notice</router-link></li>
</ul>
</nav>
<router-view></router-view>

View file

@ -176,6 +176,10 @@ const router = new VueRouter({
{
path: '/message',
component: require('./routers/message.vue')
},
{
path: '/notice',
component: require('./routers/notice.vue')
}
]
});

View file

@ -1,19 +1,21 @@
<template>
<i-button @click="pop">Pop</i-button>
<i-button type="primary" @click.native="time">打开提醒</i-button>
</template>
<script>
export default {
methods: {
pop () {
for (let i = 0; i < 6; i++) {
setTimeout(() => {
this.$Notice.open({
title: 'test',
duration: 1.5 + i
});
}, i * 500);
}
time () {
this.$Notice.open({
title: '这是通知标题',
desc: '这条通知不会自动关闭,需要点击关闭按钮才可以关闭。'
});
}
},
mounted () {
this.$Notice.config({
top: 150,
duration: 3
});
}
}
</script>