---
title: "为什么单行文本的省略样式失效？"
id: "5431ca4a8db99f42"
typeName: "小程序-开发-指南"
utime: "2026-07-28 17:55:49"
---

# 为什么单行文本的省略样式失效？

`text-overflow: ellipse` 只在 text 组件上生效，不能应用在 view 组件上，同时需要声明 `white-space: nowrap` 以及 `overflow: hidden`，建议直接使用 `<text overflow="ellipsis"/>`

## 相关文档

- [兼容](/miniprogram/dev/framework/runtime/skyline/migration/compatibility.md)
