|
|
|
|
@ -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;
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|