| | |
| | | </template> |
| | | |
| | | <script> |
| | | import E from "wangeditor"; |
| | | let E = null; |
| | | |
| | | async function loadWangEditor() { |
| | | if (!E) { |
| | | const module = await import("wangeditor"); |
| | | E = module.default || module; |
| | | } |
| | | return E; |
| | | } |
| | | |
| | | export default { |
| | | props: { |
| | | url: { |
| | |
| | | destroyed() { |
| | | this.editor = null; |
| | | }, |
| | | mounted() { |
| | | async mounted() { |
| | | this.editor = null; |
| | | let editor = new E(this.$refs.volWangEditor); |
| | | const EditorConstructor = await loadWangEditor(); |
| | | let editor = new EditorConstructor(this.$refs.volWangEditor); |
| | | this.editor = editor; |
| | | let $this = this; |
| | | editor.config.zIndex = 500; |