Kaynağa Gözat

商品详情富文本替换

hwb0 3 yıl önce
ebeveyn
işleme
87932dd7c6
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      src/views/business/goods/add.vue

+ 6 - 1
src/views/business/goods/add.vue

@@ -109,7 +109,7 @@
       <el-row>
         <el-col :span="22">
           <el-form-item label="商品详情" prop="description">
-            <TinyEditor v-model="addData.description" />
+            <wang-editor ref="editor" v-model="addData.description" />
           </el-form-item>
         </el-col>
       </el-row>
@@ -125,6 +125,7 @@
 </template>
 <script>
 import Upload from '@/components/DragImageUpload'
+import WangEditor from '@/components/WangEditor'
 import Spec from './components/spec'
 import TinyEditor from '@/components/TinyEditor'
 import { getGoodsDetail, addGoods } from '@/api/business/goods'
@@ -135,6 +136,7 @@ import { accDiv, accMul } from '@/utils/util'
 export default {
   components: {
     TinyEditor,
+    WangEditor,
     Upload,
     Spec
   },
@@ -199,6 +201,9 @@ export default {
           cost: cost == '' || cost == null ? '' : accDiv(cost, 100),
           goodsId, title, picUrl, exchangeShow, multiSku, exchangePrice, quantity, description, skuList, categoryId, tagIds
         }
+        if(description) {
+          this.$refs.editor.setContent(description)
+        }
         if (multiSku && skuList instanceof Array && skuList.length > 0) {
           this.$nextTick(() => {
             this.$refs.spec.setSkuList(skuList)