1、components新建CommentField.vue
<template>
<div class="comment-field-wrap">
<div class="comment-field__input">
<van-field
:value="value"
placeholder="请输入留言内容"
rows="1" // 显示为一行的高度
type="textarea"
autosize
maxlength="100"
@input="$emit('input', $event)" // v-model
/>
</div>
<button @click="publishComment">发表</button