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
}
},