new Files
This commit is contained in:
20
front/public/code/Simple.vue
Normal file
20
front/public/code/Simple.vue
Normal file
@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<el-button plain type="primary" @click="execCommand('print')">打印</el-button>
|
||||
<Editor doc="https://www.x-emr.cn/doc/999.html" @load="onLoad" style="margin: 10px 0;" mode="design"></Editor>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
var editor = null
|
||||
|
||||
//加载编辑器
|
||||
const onLoad = (e) => {
|
||||
editor = e.target.contentWindow.editor
|
||||
}
|
||||
|
||||
//处理文档命令
|
||||
const execCommand = (cmd) => {
|
||||
editor.execCommand(cmd)
|
||||
}
|
||||
|
||||
</script>
|
Reference in New Issue
Block a user