iview/examples/routers/message.vue

62 lines
2 KiB
Vue
Raw Normal View History

2019-08-27 09:42:40 +08:00
<template>
<div>
<Button type="primary" @click="info">Display info prompt</Button>
<Button @click="success">Display success prompt</Button>
<Button @click="warning">Display warning prompt</Button>
<Button @click="error">Display error prompt</Button>
<Button @click="loading">Display loading...</Button>
<Button @click="closable">Display a closable message</Button>
</div>
</template>
<script>
export default {
methods: {
info () {
this.$Message.info({
content: '这是一条普通的提示',
2019-09-06 09:34:52 +08:00
duration: 1000,
background: true
2019-08-27 09:42:40 +08:00
});
2019-09-06 10:05:57 +08:00
this.$Message.success({
content: '这是一条普通的提示',
duration: 1000,
background: true
});
this.$Message.warning({
content: '这是一条普通的提示',
duration: 1000,
background: true
});
this.$Message.error({
content: '这是一条普通的提示',
duration: 1000,
background: true
});
2019-08-27 09:42:40 +08:00
},
success () {
this.$Message.success('This is a success tip');
},
warning () {
this.$Message.warning('This is a warning tip');
},
error () {
this.$Message.error('This is an error tip');
},
loading () {
const msg = this.$Message.loading({
content: 'Loading...',
duration: 0
});
setTimeout(msg, 3000);
},
closable () {
this.$Message.info({
content: 'Tips for manual closing',
duration: 1000,
closable: true
});
}
}
}
</script>