File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ export default {
227
227
},
228
228
watch: {
229
229
value (event ){
230
+ this .valuex = this .value ;
230
231
this .$emit (' change' ,event )
231
232
},
232
233
active (){
Original file line number Diff line number Diff line change @@ -297,7 +297,7 @@ export default {
297
297
obj .forEach ((item ) => {
298
298
getStrings (item)
299
299
})
300
- } else if (typeof obj == ' object' ) {
300
+ } else if (obj && typeof obj == ' object' ) {
301
301
let subObj = Object .values (obj)
302
302
strings = [... strings,... subObj]
303
303
getStrings (subObj)
@@ -313,7 +313,7 @@ export default {
313
313
getStrings (obj , valuesx ) {
314
314
let stringsx = Object .values (obj)
315
315
valuesx .forEach ((item ) => {
316
- if (typeof item == ' object' ) {
316
+ if (item && typeof item == ' object' ) {
317
317
valuesx = [... valuesx,... Object .values (item)]
318
318
}
319
319
})
Original file line number Diff line number Diff line change 1
1
<template lang="html">
2
2
<div
3
- :class =" {'textarea-danger': counter ? value.length > counter : false, 'focusx': focusx}"
3
+ :class =" {'textarea-danger': counter ? ( value && value .length > counter) : false, 'focusx': focusx}"
4
4
:style =" getStyle"
5
5
class =" vs-component vs-con-textarea" >
6
6
19
19
<div
20
20
v-if =" counter"
21
21
class =" count vs-textarea--count" >
22
- {{ value.length }} / {{ counter }}
22
+ {{ value ? value .length : 0 }} / {{ counter }}
23
23
</div>
24
24
25
25
</div>
@@ -85,7 +85,7 @@ export default {
85
85
},
86
86
watch: {
87
87
value () {
88
- if (this .value .length > this .counter ) {
88
+ if (this .value && this . value .length > this .counter ) {
89
89
this .$emit (' update:counterDanger' , true )
90
90
} else {
91
91
this .$emit (' update:counterDanger' , false )
You can’t perform that action at this time.
0 commit comments