feat: 长文本组件调整

This commit is contained in:
2026-03-25 16:33:35 +08:00
parent 14d2ad7b53
commit 00c58d47b9
5 changed files with 30 additions and 15 deletions

View File

@@ -27,10 +27,15 @@ import { ref } from 'vue'
const isOverflow = ref(true)
// 直接根据文字长度判断超过约100个字符认为会溢出约3行
const answerText = '建议一定要去「东华门」看角楼夕阳,那里是摄影师的私藏机位。御花园目前的玉兰花开得正好,别忘了抬头看看红墙上的猫。建议一定要去「东华门」看角楼夕阳,那里是摄影师的私藏机位。御花园目前的玉兰花开得正好,别忘了抬头看看红墙上的猫。'
const props = defineProps({
answerText: {
type: String,
default: "",
}
});
// 简单判断12号字体3行约100个字符
isOverflow.value = answerText.length > 100
isOverflow.value = props.answerText.length > 100
</script>