首先准备一个计算字符个数的函数//计算字符个数byteCount(str){constcount=(str&&str.replace(/[^\x00-\xff]/g,"xx").length)||0;returncount;},处理从接口获取的数据。如果此处的字符数大于170,则会显示展开按钮。这个数字需要慢慢调试list.forEach((item)=>{if(this.byteCount(item.info)>170){item.spread=false;}展开折叠标签写法

首先准备一个计算字符个数的函数//计算字符个数byteCount(str){constcount=(str&&str.replace(/[^\x00-\xff]/g,"xx").length)||0;returncount;},处理从接口获取的数据。如果此处的字符数大于170,则会显示展开按钮。这个数字需要慢慢调试list.forEach((item)=>{if(this.byteCount(item.info)>170){item.spread=false;}展开折叠标签写法