textarea去除空格

<el-form-item label="券规则说明" prop="couponDesc">
    <div style="display: flex;align-items: end;">
        <el-input v-model="ruleForm.data.couponDesc" type="textarea" style="width: 400px;" :rows="8" maxlength="5000" show-word-limit />
        <el-button type="primary" link @click="clickBtn(ruleFormRef)">生成规则说明el-button>
    div>
el-form-item>
      ruleForm.data.couponDesc = text.trim().replaceAll(/([\n\r])+/g, "\n");

你可能感兴趣的:(Vue.js,javascript)