效果图:
刘德华----------刘*
加v-if判断是因为如果是后台数据返回的字段,如果不加判断,substring的时候有可能数据还没渲染完,会报错
<text v-if="userName">{
{
userName.substring(0, 1) + '*'}}</text>
效果图:
刘德华----------刘*
加v-if判断是因为如果是后台数据返回的字段,如果不加判断,substring的时候有可能数据还没渲染完,会报错
<text v-if="userName">{
{
userName.substring(0, 1) + '*'}}</text>