<template>
  <div>
    <UE ref="ue" :defaultMsg="formData.description"></UE>
  </div>
</template>
<script>

export default {
  name: 'goodsEditFormDescription',
  props: {
    propFormData: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      // 表单数据
      formData: {
        description: ''
      },
      formRules: {}
    }
  },
  mounted() {

  },
  methods: {
    /** 表单校验 */
    async validateForm() {
      try {
        // await this.$refs.formRef.validate()
        this.formData.description = this.$refs['ue'].getUEContent()
        // 校验通过更新数据
        Object.assign(this.propFormData, this.formData)
      } catch (e) {
        this.$message.error('【商品详情】不完善，请填写相关信息')
        this.$emit('updateActiveTab', 'description')
        // 截断父组件后面的代码
        throw e
      }
    }
  },
  watch: {
    propFormData: {
      handler(newVal) {
        this.formData = newVal
      }
    }
  }
}
</script>
