element input输入多行内容反显时自动换行
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element

·
当点击编辑按钮对原因进行编辑修改时,弹出编辑弹窗,当在el-input 组件里输入内容过多时,在页面回显时内容不能够进行换行处理,造成页面显示不美观。
页面代码:
<div id="print" style="background-color: #f2f6f9;padding: 0px 20px 0px 20px;width: 74%;margin: 10px auto;">
<div style="margin-top: 80px;text-align: center;font-size: 24pt;font-family: 'SimSun', '宋体';">
<b>xxxx通知</b>
</div>
<div
style="font-size: 18pt; font-family: '仿宋'; text-align: initial; text-indent: 2em; color: #222222; letter-spacing: 2px; margin-top: 20px;">
<div style="line-height: 30px;">本人{{ "王峰" }}由于{{ refInfo.examineReason != null ? refInfo.examineReason :
refInfo.cancelRegistrationReason }}和张小姐决定解除婚姻关系。
</div>
<div style="margin: 5px 0px 80px 0px;">特此通知。</div>
</div>
</div>
编辑弹窗代码:
<el-dialog title="编辑理由" :visible.sync="dialogFormVisible" width="30%" :close-on-click-modal="false"
:close-on-press-escape="false" :show-close="false" center>
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label-width="120px" prop="content" label="理由">
<el-input v-model="form.content" size="small" type="textarea" :rows="2" placeholder="请输入理由"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="btn('form')">确定</el-button>
<el-button size="small" @click="cancel">取消</el-button>
</div>
</el-dialog>
解决方法:设置对应标签 css 样式
1 white-space: pre-wrap;
2 word-break: break-all;
<div id="print" style="background-color: #f2f6f9;padding: 0px 20px 0px 20px;width: 74%;margin: 10px auto;">
<div style="margin-top: 80px;text-align: center;font-size: 24pt;font-family: 'SimSun', '宋体';">
<b>xxxx通知</b>
</div>
<div
style="font-size: 18pt; font-family: '仿宋'; text-align: initial; text-indent: 2em; color: #222222; letter-spacing: 2px; margin-top: 20px;">
<div style="line-height: 30px;word-break: break-all;">本人{{ "王峰" }}由于{{ refInfo.examineReason != null ? refInfo.examineReason :
refInfo.cancelRegistrationReason }}和张小姐决定解除婚姻关系。
</div>
<div style="margin: 5px 0px 80px 0px;">特此通知。</div>
</div>
</div>




A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:6 个月前 )
c345bb45
10 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 10 个月前
更多推荐
所有评论(0)