<!--
 * @Descripttion:
 * @Version: 1.0
 * @Author: +C
 * @Date: 2022-02-17 11:43:50
 * @LastEditors: lr

 * @LastEditTime: 2022-07-05 15:04:30
-->
<template>
  <div></div>
</template>

<script>
export default {
  name: '',
  //页面引用的组件
  components: {},
  //父页面传递参数
  props: {},
  data() {
    return {
      // isDetail: true
      formDom: null
    };
  },
  //监控计算变量
  computed: {
    // 计算属性的 getter
    isDetail: function () {
      this.findForCompom(this)

      // let isDetail = this.$attrs.hasOwnProperty('is-detail') ? this.$attrs['is-detail'] : this.formDom.$attrs['is-detail']

      let isDetail;

      if (this.formDom) {
        isDetail = this.$attrs.hasOwnProperty('is-detail') ? this.$attrs['is-detail'] : this.formDom.$attrs['is-detail']
      } else {
        // console.log(this.$attrs.hasOwnProperty('is-detail'), this.$attrs['is-detail']);
        isDetail = this.$attrs.hasOwnProperty('is-detail') ? this.$attrs['is-detail'] : false
      }

      return isDetail
    },

    bordered: function () {
      this.findForCompom(this)

      // let isDetail = this.$attrs.hasOwnProperty('is-detail') ? this.$attrs['is-detail'] : this.formDom.$attrs['is-detail']

      let bordered;

      if (this.formDom) {
        bordered = this.$attrs.hasOwnProperty('bordered') ? this.$attrs['bordered'] : this.formDom.$attrs['bordered']
      } else {
        bordered = this.$attrs.hasOwnProperty('bordered') ? this.$attrs['bordered'] : false
      }

      return bordered
    }

  },
  //监听
  watch: {},
  //页面的构造方法
  created() {
  },
  //父页面定义方法给子页面inject调用
  providee() { return {} },
  //子组件调用注入到父页面providee
  inject: [],
  //dom加载完
  mounted() {

  },
  //页面的自定义方法
  methods: {

    /**
     * @description: 查找父节点是有$vxeform的节点
     * @author: +c
     * @param {*} com
     * @return {*}
     */
    findForCompom(com) {
      if (com && !this.formDom) {
        if (com.hasOwnProperty('$vxeform')) {
          this.formDom = com['$vxeform']
        } else {
          this.findForCompom(com.$parent)
        }
      }

    }
  }
};
</script>

<style scoped>
</style>