first commit
This commit is contained in:
67
src/components/SubMid.vue
Normal file
67
src/components/SubMid.vue
Normal file
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div ref="subMid" id="subMid"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import E from 'wangeditor'
|
||||
var phoneEditor, _this
|
||||
export default {
|
||||
components: {},
|
||||
props: {
|
||||
subMidVal: {
|
||||
type: String,
|
||||
required: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
created () { },
|
||||
mounted () {
|
||||
_this = this
|
||||
phoneEditor = new E(this.$refs.subMid)
|
||||
phoneEditor.customConfig.pasteFilterStyle = false
|
||||
phoneEditor.customConfig.onchange = html => {
|
||||
_this.$emit('subMid', 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()
|
||||
},
|
||||
methods: {},
|
||||
computed: {},
|
||||
watch: {
|
||||
subMidtVal (val) {
|
||||
phoneEditor.txt.html(val)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
#subMid {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
font-family: "宋体" !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user