7c15ac9e
梁灏
add Message compo...
|
1
2
3
4
5
|
<template>
<Button @click="info">info</Button>
<Button @click="success">success</Button>
<Button @click="error">error</Button>
<Button @click="warning">warning</Button>
|
47e58396
梁灏
message component...
|
6
|
<Button @click="loading">手动消失</Button>
|
d3671687
梁灏
add destroy() for...
|
7
|
<Button @click="destroy">destroy</Button>
|
be966e9f
梁灏
add Modal component
|
8
9
10
11
12
13
14
15
16
|
<Alert closable>消息提示文案</Alert>
<Alert type="success" show-icon closable>
成功提示文案
<span slot="desc">成功的提示描述文案成功的提示描述文案成功的提示描述文案成功的提示描述文案成功的提示描述文案</span>
</Alert>
<Card :bordered="false">
<p slot="title">无边框标题</p>
<p>无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充无边框内容填充。</p>
</Card>
|
7c15ac9e
梁灏
add Message compo...
|
17
18
|
</template>
<script>
|
be966e9f
梁灏
add Modal component
|
19
|
import { Message, Button, Alert, Card } from 'iview';
|
7c15ac9e
梁灏
add Message compo...
|
20
21
22
23
|
export default {
components: {
Message,
|
be966e9f
梁灏
add Modal component
|
24
25
26
|
Button,
Alert,
Card
|
7c15ac9e
梁灏
add Message compo...
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
},
props: {
},
data () {
return {
}
},
computed: {
},
methods: {
info () {
Message.info('欢迎来到iView', 3, () => {
console.log('close info');
});
},
success () {
Message.success('成功啦', 5, () => {
console.log('close successs');
});
},
error () {
Message.error('错误啦');
},
warning () {
Message.warning('来个警告');
},
loading () {
|
47e58396
梁灏
message component...
|
57
58
59
|
const hide = Message.loading('我是loading', 0);
setTimeout(hide, 5000);
|
d3671687
梁灏
add destroy() for...
|
60
61
62
|
},
destroy () {
Message.destroy();
|
7c15ac9e
梁灏
add Message compo...
|
63
64
65
|
}
},
ready () {
|
47e58396
梁灏
message component...
|
66
67
68
69
|
// Message.config({
// top: 50,
// duration: 8
// });
|
7c15ac9e
梁灏
add Message compo...
|
70
71
72
|
}
}
</script>
|