效果图 代码 <span class="tax-news-content">{{ truncateText(item.content, 17) }}</span> methods: { truncateText(text, maxLength) { if (text.length > maxLength) { return text.slice(0, maxLength) + '...'; } return text; } }