<textarea class="textarea" v-model="text" placeholder="" :focus="autoFocus" @focus="onFocus"
@blur="onBlur" :maxlength="300" :cursor="input.cursor" @input="inputHandler" /> const inputHandler = (event) => {
console.log("输入", event.detail)
text.value = event.detail.value
if (text.value > 300) {
text.value = text.value.slice(0, 300)
}
}这段代码有问题吗
https://developers.weixin.qq.com/miniprogram/dev/component/textarea.html
文档排查
<textarea class="textarea" v-model="text" placeholder="" :focus="autoFocus" @focus="onFocus"
@blur="onBlur" :maxlength="300" :cursor="input.cursor" @input="inputHandler" /> const inputHandler = (event) => {
console.log("输入", event.detail)
text.value = event.detail.value
if (text.value > 300) {
text.value = text.value.slice(0, 300)
}
}这段代码有问题吗