File tree Expand file tree Collapse file tree 4 files changed +17
-13
lines changed Expand file tree Collapse file tree 4 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -142,8 +142,7 @@ export default {
142
142
// 检查是否存在未命名动画,避免重复添加
143
143
if (this .$store .state .animation .some (val => val .name === ' ' )) {
144
144
window .$communicator .$emit (' notify' , {
145
- info: ' 还有未命名动画,请先命名' ,
146
- type: false
145
+ info: ' 还有未命名动画,请先命名'
147
146
})
148
147
return
149
148
}
@@ -176,8 +175,7 @@ export default {
176
175
this .currentAnimation .name = ' '
177
176
})
178
177
window .$communicator .$emit (' notify' , {
179
- info: ' 动画名称必须以英文开头' ,
180
- type: false
178
+ info: ' 动画名称必须以英文开头'
181
179
})
182
180
}
183
181
@@ -186,8 +184,7 @@ export default {
186
184
this .currentAnimation .name = value .replace (/ \W / g , ' ' )
187
185
})
188
186
window .$communicator .$emit (' notify' , {
189
- info: ' 请勿使用英文和数字以外的字符' ,
190
- type: false
187
+ info: ' 请勿使用英文和数字以外的字符'
191
188
})
192
189
}
193
190
},
Original file line number Diff line number Diff line change 1
1
<!-- based on muse-ui -->
2
2
<!-- http://www.muse-ui.org/#/slider -->
3
- <!-- TODO: use input range -->
3
+ <!-- TODO: use input range instead -->
4
4
<template >
5
5
<div :class =" {'mu-lisder-wrapper': tuning}" >
6
6
<div class =" mu-slider" :class =" sliderClass"
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<transition name =" drop" >
3
- <div class =" toast" v-show =" show" >{{ info }}</div >
3
+ <div class =" toast" :class = " klass " v-show =" show" >{{ info }}</div >
4
4
</transition >
5
5
</template >
6
6
@@ -9,10 +9,19 @@ export default {
9
9
data () {
10
10
return {
11
11
info: ' ' ,
12
- type: true ,
12
+ type: ' warning ' ,
13
13
show: false
14
14
}
15
15
},
16
+ computed: {
17
+ klass () {
18
+ return {
19
+ ' toast-success' : this .type === ' success' ,
20
+ ' toast-warning' : this .type === ' warning' ,
21
+ ' toast-error' : this .type === ' error'
22
+ }
23
+ }
24
+ },
16
25
mounted () {
17
26
window .$communicator .$on (' notify' , (option ) => {
18
27
this .notify (option .info , option .type )
@@ -22,8 +31,7 @@ export default {
22
31
notify (info , type ) {
23
32
if (this .show ) return
24
33
this .info = info || ' Success!'
25
- // FIXME: type = "success" or "warning"
26
- this .type = type || true
34
+ if (type) this .type = type
27
35
this .show = true
28
36
setTimeout (() => {
29
37
this .show = false
Original file line number Diff line number Diff line change @@ -103,8 +103,7 @@ export default {
103
103
state . counter += 1
104
104
} else {
105
105
window . $communicator . $emit ( 'notify' , {
106
- info : '只有命名容器才能复制,请先命名' ,
107
- type : false
106
+ info : '只有命名容器才能复制,请先命名'
108
107
} )
109
108
}
110
109
}
You can’t perform that action at this time.
0 commit comments