<!--
<base-info-show></base-info-show>

import baseInfoShow from '@/components/api/base-info-show.vue';
-->
<template>
  <div class="base-info-show border-box">
    <el-form label-width="120px" :model="apiInfoData">
      <el-form-item label="API名称:">
        {{ apiInfoData.interfaceName }}
      </el-form-item>
      <el-form-item label="API类型:">
        {{ apiInfoData.target == 1 ? '公开' : '私有' }}
      </el-form-item>
      <el-form-item label="访问类型:">
        {{ apiInfoData.requestType }}
      </el-form-item>
      <el-form-item label="描述:">
        {{ apiInfoData.interfaceDescribe }}
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  name: 'base-info-show',
  props: {
    apiData: {
      type: [Object, Array],
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      apiInfoData: {
        /*  interfaceName: '1',
        target: '1',
        requestType: 'get',
        interfaceDescribe: 'test' */
      }
    };
  },

  watch: {
    apiData: function(newData, oldData) {
      const that = this;
      that.apiInfoData = newData;
    }
  },
  mounted() {
    const that = this;
    that.apiInfoData = that.apiData;
  }
};
</script>
<style lang="less" scoped>
.w-320 {
  width: 320px;
}
.m-t-14 {
  margin-top: 14px;
}
.base-info-show {
  width: 100%;

  .el-form {
    /deep/ .el-form-item__label {
      color: #606266;
    }
    /deep/ .el-form-item__content {
      color: #303133;
    }
  }
}
</style>
