feat: 长文本组件调整
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user