lex-xin 5 lat temu
rodzic
commit
a01de0d7b7
2 zmienionych plików z 28 dodań i 54 usunięć
  1. 3 1
      package.json
  2. 25 53
      src/views/contentManager/contentOperation.vue

+ 3 - 1
package.json

@@ -15,18 +15,20 @@
     "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
   },
   "dependencies": {
+    "@tinymce/tinymce-vue": "^3.0.1",
     "axios": "0.18.1",
     "default-passive-events": "^1.0.10",
     "element-ui": "^2.12.0",
     "js-cookie": "2.2.0",
     "normalize.css": "7.0.0",
+    "npm": "^6.13.0",
     "nprogress": "0.2.0",
     "path-to-regexp": "2.4.0",
     "qrcodejs2": "0.0.2",
     "qs": "^6.8.0",
+    "tinymce": "^5.1.1",
     "vue": "2.6.10",
     "vue-amap": "^0.5.10",
-    "vue-quill-editor": "^3.0.6",
     "vue-router": "3.0.6",
     "vuex": "3.1.0"
   },

+ 25 - 53
src/views/contentManager/contentOperation.vue

@@ -26,13 +26,13 @@
         </el-form-item>
         <el-form-item label="商品描述" prop="desc" >
           <!-- bidirectional data binding(双向数据绑定) -->
-            <quill-editor v-model="content"
+            <!-- <quill-editor v-model="content"
                 ref="myQuillEditor"
                 :options="editorOption"
                 @blur="onEditorBlur($event)"
                 @focus="onEditorFocus($event)"
                 @ready="onEditorReady($event)">
-            </quill-editor>
+            </quill-editor> -->
         </el-form-item>
         <el-form-item>
           <el-button @click="onSubmit('form')" type="primary">立即{{ pageType == "create" ? '创建' : '修改' }}</el-button>
@@ -48,11 +48,11 @@ import store from '@/store'
 import { getToken } from '@/utils/auth'
 // import E from 'wangeditor'
 // require styles
-import 'quill/dist/quill.core.css'
-import 'quill/dist/quill.snow.css'
-import 'quill/dist/quill.bubble.css'
+// import 'quill/dist/quill.core.css'
+// import 'quill/dist/quill.snow.css'
+// import 'quill/dist/quill.bubble.css'
 
-import { quillEditor } from 'vue-quill-editor'
+// import { quillEditor } from 'vue-quill-editor'
 export default {
     components: {
         quillEditor
@@ -89,35 +89,7 @@ export default {
         }
     },
     mounted() {
-        // this.getList()
-        // this.editor = new E(this.$refs.editorElem)
-        // this.editor.customConfig.onchange = html => {
-        //   this.editorContent = html
-        // };
-        // this.editor.customConfig.menus = [
-        //   // 菜单配置
-        //   'head', // 标题
-        //   'bold', // 粗体
-        //   'fontSize', // 字号
-        //   'fontName', // 字体
-        //   'italic', // 斜体
-        //   'underline', // 下划线
-        //   'strikeThrough', // 删除线
-        //   'foreColor', // 文字颜色
-        //   'backColor', // 背景颜色
-        //   'link', // 插入链接
-        //   'list', // 列表
-        //   'justify', // 对齐方式
-        //   'quote', // 引用
-        //   'emoticon', // 表情
-        //   'image', // 插入图片
-        //   'table', // 表格
-        //   'code', // 插入代码
-        //   'undo', // 撤销
-        //   'redo' // 重复
-        // ]
-        // this.editor.create() // 创建富文本实例
-        console.log('this is current quill instance object', this.editor)
+        // console.log('this is current quill instance object', this.editor)
     },
     methods: {
         onSubmit(formName) {
@@ -225,25 +197,25 @@ export default {
         }
         return tempTitle[type]
         },
-        onEditorBlur(quill) {
-            console.log('editor blur!', quill)
-        },
-        onEditorFocus(quill) {
-            console.log('editor focus!', quill)
-        },
-        onEditorReady(quill) {
-            console.log('editor ready!', quill)
-        },
-        onEditorChange({ quill, html, text }) {
-            console.log('editor change!', quill, html, text)
-            this.content = html
-        }
-    },
-    computed: {
-      editor() {
-        return this.$refs.myQuillEditor.quill
-      }
+        // onEditorBlur(quill) {
+        //     console.log('editor blur!', quill)
+        // },
+        // onEditorFocus(quill) {
+        //     console.log('editor focus!', quill)
+        // },
+        // onEditorReady(quill) {
+        //     console.log('editor ready!', quill)
+        // },
+        // onEditorChange({ quill, html, text }) {
+        //     console.log('editor change!', quill, html, text)
+        //     this.content = html
+        // }
     },
+    // computed: {
+    //   editor() {
+    //     return this.$refs.myQuillEditor.quill
+    //   }
+    // },
 }
 </script>
 <style lang="scss" scoped>