<template>
  <div>
    <el-form :disabled="!!$route.query.type" ref="form" :rules="rules" :model="data" label-width="100px">
      <el-form-item label="按钮文案：" prop="title">
        <el-input v-model="data.title"></el-input>
      </el-form-item>
      <el-form-item label="页面展示：" prop="desc">
        <v-editor :disabled="!!$route.query.type" v-model="data.desc"></v-editor>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import VEditor from '@/components/tinymce/Index.vue'
export default {
  components: { VEditor },
  props: {
    data: { type: Object, default: () => {} }
  },
  data() {
    return {
      form: {
        edit: '',
        btnText: ''
      },
      rules: {
        title: [{ required: true, message: '请填写按钮文案', trigger: 'change' }],
        desc: [{ required: true, message: '请填写页面内容', trigger: 'change' }]
      }
    }
  },
  methods: {
    submitForm() {
      let flag = false
      this.$refs.form.validate(valid => {
        if (valid) {
          flag = true
        }
      })
      return flag
    }
  },
  mounted() {
    console.log(this.data, 'display')
  }
}
</script>

<style lang="scss">
.tox-notifications-container {
  display: none !important;
}
</style>
