Text beyond the specified characters is omitted

If the text has a fixed width, it can be omitted using css

white-space: nowrap; 
overflow: hidden;
text-overflow: ellipsis;

If there is no width, there is no way to use css to omit.
You can use filter writing to omit

 <view>库存:{
    
    {
    
      item.product_stock | statusFilter  }}</view>

 filters: {
    
    
    statusFilter(status) {
    
    
      var value = JSON.stringify(status).slice(0, 6)
      return Number(value)
    },
    nameFilter(status) {
    
    
      if (status.length>5) {
    
    
        var value = status.slice(0, 5) + '...'
        return value
      }
      else return status
    }
  },

Guess you like

Origin blog.csdn.net/xiaokangna/article/details/126655521