no message

cyl/master-0822^2
jscyl13849007907 3 months ago
parent b0632e6210
commit e2a02d5cc4

@ -31,7 +31,7 @@
cusMessage: {
handler(newVal) {
console.log('newVal',newVal)
const hasDot = newVal.endsWith('。');
const hasDot = String(newVal).endsWith('。');
const messageWithoutDot = hasDot ? newVal.slice(0, -1) : newVal;
this.displayedMessage = messageWithoutDot;
if (this.isShow) {
@ -45,9 +45,12 @@
'isRender': {
handler(newVal) {
this.isShow = newVal;
const hasDot = this.cusMessage.endsWith('。');
const messageWithoutDot = hasDot ? this.cusMessage.slice(0, -1) : this.cusMessage;
this.displayedMessage = this.isShow ? messageWithoutDot + '...' : (hasDot ? messageWithoutDot + '。' : messageWithoutDot);
if(this.cusMessage){
let _str = String(this.cusMessage);
const hasDot = _str.endsWith('。');
const messageWithoutDot = hasDot ? _str.slice(0, -1) : _str;
this.displayedMessage = this.isShow ? messageWithoutDot + '...' : (hasDot ? messageWithoutDot + '。' : messageWithoutDot);
}
},
immediate: true
}

Loading…
Cancel
Save