| 1 |
- {"remainingRequest":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/index.js??vue-loader-options!/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/src/components/editor/editor.vue?vue&type=script&lang=js&","dependencies":[{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/src/components/editor/editor.vue","mtime":1618306924000},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":1665684022107},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/babel-loader/lib/index.js","mtime":1665684010704},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/cache-loader/dist/cjs.js","mtime":1665684022107},{"path":"/usr/local/develop/php/www/waibao/NN2022100801/NN2022100801/addons/admin/node_modules/vue-loader/lib/index.js","mtime":1665684006084}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n\nimport Editor from 'wangeditor'\nimport 'wangeditor/release/wangEditor.min.css'\nimport { oneOf } from '@/libs/tools'\nexport default {\n name: 'Editor',\n props: {\n value: {\n type: String,\n default: ''\n },\n /**\n * 绑定的值的类型, enum: ['html', 'text']\n */\n valueType: {\n type: String,\n default: 'html',\n validator: (val) => {\n return oneOf(val, ['html', 'text'])\n }\n },\n /**\n * @description 设置change事件触发时间间隔\n */\n changeInterval: {\n type: Number,\n default: 200\n },\n /**\n * @description 是否开启本地存储\n */\n cache: {\n type: Boolean,\n default: true\n }\n },\n computed: {\n editorId () {\n return `editor${this._uid}`\n }\n },\n methods: {\n setHtml (val) {\n this.editor.txt.html(val)\n }\n },\n mounted () {\n this.editor = new Editor(`#${this.editorId}`)\n this.editor.customConfig.onchange = (html) => {\n let text = this.editor.txt.text()\n if (this.cache) localStorage.editorCache = html\n this.$emit('input', this.valueType === 'html' ? html : text)\n this.$emit('on-change', html, text)\n }\n this.editor.customConfig.onchangeTimeout = this.changeInterval\n // create这个方法一定要在所有配置项之后调用\n this.editor.create()\n // 如果本地有存储加载本地存储内容\n let html = this.value || localStorage.editorCache\n if (html) this.editor.txt.html(html)\n }\n}\n",{"version":3,"sources":["editor.vue"],"names":[],"mappings":";;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"editor.vue","sourceRoot":"src/components/editor","sourcesContent":["<template>\n <div class=\"editor-wrapper\">\n <div :id=\"editorId\"></div>\n </div>\n</template>\n\n<script>\nimport Editor from 'wangeditor'\nimport 'wangeditor/release/wangEditor.min.css'\nimport { oneOf } from '@/libs/tools'\nexport default {\n name: 'Editor',\n props: {\n value: {\n type: String,\n default: ''\n },\n /**\n * 绑定的值的类型, enum: ['html', 'text']\n */\n valueType: {\n type: String,\n default: 'html',\n validator: (val) => {\n return oneOf(val, ['html', 'text'])\n }\n },\n /**\n * @description 设置change事件触发时间间隔\n */\n changeInterval: {\n type: Number,\n default: 200\n },\n /**\n * @description 是否开启本地存储\n */\n cache: {\n type: Boolean,\n default: true\n }\n },\n computed: {\n editorId () {\n return `editor${this._uid}`\n }\n },\n methods: {\n setHtml (val) {\n this.editor.txt.html(val)\n }\n },\n mounted () {\n this.editor = new Editor(`#${this.editorId}`)\n this.editor.customConfig.onchange = (html) => {\n let text = this.editor.txt.text()\n if (this.cache) localStorage.editorCache = html\n this.$emit('input', this.valueType === 'html' ? html : text)\n this.$emit('on-change', html, text)\n }\n this.editor.customConfig.onchangeTimeout = this.changeInterval\n // create这个方法一定要在所有配置项之后调用\n this.editor.create()\n // 如果本地有存储加载本地存储内容\n let html = this.value || localStorage.editorCache\n if (html) this.editor.txt.html(html)\n }\n}\n</script>\n\n<style>\n\n</style>\n"]}]}
|