效果图
html部分
<view class="xiangdui">
<uni-easyinput type="textarea" v-model="miaoshu" @input="inputChange" maxlength="100" placeholder="写段话描述下吧"></uni-easyinput>
<view class="juedui">{
{ inputValueLength ? inputValueLength : 0 }}/100 </view>
</view>
js部分
<script>
export default {
data() {
return {
miaoshu:'',
inputValueLength:'',
}
},
onLoad( option ) {
},
onHide() {
},
onUnload() {
},
methods: {
inputChange(e) {
this.inputValueLength = parseInt(e.length);
console.log('输入的内容',this.inputValueLength)
}
}
}
</script>
style部分
<style>
.xiangdui {
position: relative;
}
.juedui {
position: absolute;
right: 10px;
bottom: 0;
color: #646464;
}
</style>