Files
chaoyangpc/src/components/Scheduling.vue
2019-11-27 00:27:22 +08:00

69 lines
1.4 KiB
Vue

<template>
<div ref="scheduling" id="scheduling"></div>
</template>
<script>
import E from 'wangeditor'
var phoneEditor, _this
export default {
components: {},
props: {
schedulingVal: {
type: String,
required: false
}
},
data () {
return {}
},
created () {},
mounted () {
_this = this
phoneEditor = new E(this.$refs.scheduling)
phoneEditor.customConfig.pasteFilterStyle = false
phoneEditor.customConfig.onchange = html => {
_this.$emit('scheduling', html)
}
phoneEditor.customConfig.menus = [
'head', // 标题
'bold', // 粗体
'fontSize', // 字号
'fontName', // 字体
'italic', // 斜体
'underline', // 下划线
'strikeThrough', // 删除线
'foreColor', // 文字颜色
'backColor', // 背景颜色
// 'link', // 插入链接
// 'list', // 列表
'justify', // 对齐方式
// 'quote', // 引用
// 'emoticon', // 表情
// 'image', // 插入图片
'table', // 表格
// 'video', // 插入视频
// 'code', // 插入代码
'undo', // 撤销
'redo' // 重复
]
phoneEditor.create()
// phoneEditor.$txt.html(this.val)
},
methods: {},
computed: {},
watch: {
schedulingVal (val) {
phoneEditor.txt.html(val)
}
}
}
</script>
<style lang="scss" scoped>
#scheduling {
width: 100%;
height: 250px;
font-family: "宋体" !important;
}
</style>