rt-sim-training-client/src/views/competitionManage/bankList/dialog-modify-rich.vue

47 lines
1.2 KiB
Vue
Raw Normal View History

2020-05-26 15:59:11 +08:00
<template>
<el-dialog v-dialogDrag :close-on-click-moda="false" :title="title" :visible.sync="show" width="40%" :close-on-click-modal="false" :before-close="doClose">
<quill-editor v-model="content" placeholder="请输入内容" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doInput"> </el-button>
<el-button @click="show = false"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
show: false,
content: '',
node: {
model: {},
prop: ''
}
};
},
computed: {
title() {
return '富文本输入';
}
},
methods: {
doShow(node) {
this.node = node;
this.content = (node.model || {})[node.prop] || '';
this.show = true;
},
doClose(done) {
this.show = false;
},
doInput() {
const node = this.node;
node.model[node.prop] = this.content;
this.$emit('update', node.model);
this.doClose();
}
}
};
</script>