富文本定位问题

This commit is contained in:
熊丽君
2021-12-10 10:32:45 +08:00
parent fbca089683
commit 170d1d99c3

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="app-container" ref="container" style="height: calc(100vh - 84px);overflow:scroll">
<div>{{ editPage ? '修改' : '添加' }}资讯</div>
<el-form
style="width:50%;margin:15px 0 0 15px"
@ -13,7 +13,7 @@
<el-input placeholder="请输入" maxlength="48" show-word-limit v-model="ruleForm.title"></el-input>
</el-form-item>
<el-form-item label="正文" prop="text">
<editor v-model="ruleForm.text" :min-height="192" />
<editor ref="textEditor" v-model="ruleForm.text" :min-height="192" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')"
@ -44,6 +44,16 @@ export default {
}
};
},
mounted(){
document.addEventListener('paste', (e)=> {
this.$nextTick(() => {
let container = this.$el;
setTimeout(()=>{
container.scrollTop = container.scrollHeight;
},0)
});
});
},
methods: {
submitForm(formName) {
this.$refs[formName].validate(valid => {