forked from chengxulvtu/cxlt-vue2-toastr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
48 lines (44 loc) · 1.11 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<div>
<cxlt-toastr :show="show"
:toastr="toastr"
@show-change="showChange"></cxlt-toastr>
<button @click="switchShow">click me</button>
</div>
</template>
<script>
export default {
name: 'App',
data: () => {
return {
show: false,
toastr: {
// title: '成功提示',
// message: '保存角色成功',
// position: 'top left'
title: '',
closeButton: true,
timeOut: 5000,
showDuration: 5000,
delay: 3000
}
}
},
methods: {
switchShow() {
this.show = !this.show
// this.toastr = {
// title: '提示',
// message: '保存角色成功'
// }
this.toastr.title = '提示'
this.toastr.message = '保存角色成功'
},
showChange(show) {
if (this.show !== show) {
this.show = show
}
}
}
}
</script>