Browse Source

富文本内容获取

master
aBin 3 years ago
parent
commit
e35afafdca
  1. 9
      src/components/Detail/addOrEdit.vue
  2. 3
      src/components/Detail/editor.vue
  3. 9
      src/components/Detail/index.vue

9
src/components/Detail/addOrEdit.vue

@ -11,7 +11,7 @@
</el-cascader>
</el-form-item>
<el-form-item label="正文:" prop="content">
<editor />
<editor ref="editor" />
<!-- <el-input
type="textarea"
:rows="2"
@ -90,8 +90,11 @@
submit(formName) {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
const child = this.$refs['editor']
formName.content = child.getValue();
if(this.showAdd){
this.addCarousel(formName)
}else{
this.updateCarousel(formName)
}
@ -114,7 +117,7 @@
await ADD_DETAIL(params).then((res) => {
if(res.code === 200){
Alert.success('添加成功');
this.$emit('close', true)
this.$emit('close')
}else{
Alert.fail(res.msg || '添加失败');
}
@ -134,7 +137,7 @@
await UPDATE_DETAIL(params).then((res) => {
if(res.code === 200){
Alert.success('修改成功');
this.$emit('close', true)
this.$emit('close')
}else{
Alert.fail(res.msg || '修改失败');
}

3
src/components/Detail/editor.vue

@ -34,6 +34,9 @@ export default {
handleChange(value){
console.log('value: ', value);
},
getValue() {
return this.tuieditor.getHtml()
}
}
};

9
src/components/Detail/index.vue

@ -110,6 +110,7 @@
:show-close="false"
:visible.sync="showModal">
<add-or-edit ref="distribution" :show-add="showAdd" :currList="currList" v-if="showModal" @close="close"></add-or-edit>
<!-- <el-button type="primary" @click="dialogVisible = false"> </el-button> -->
</el-dialog>
</div>
</template>
@ -240,18 +241,16 @@
},
editModal(currList) {
this.currList = currList;
this.showModal = true;
this.showAdd = false;
// this.id = id;
this.currList = currList
},
//
close(type){
close(){
this.showModal = false
if(type){
this.getList()
}
this.getList()
},
/**

Loading…
Cancel
Save