<template>
  <div>
    <fast2-component-render
      :list="item.data"
      :mode="mode"
      v-on="$listeners"
      v-bind="$attrs"
    ></fast2-component-render>
  </div>
</template>
<script>
import { ft } from '../../../lib/utils.js';

const LABELS = {
  staticResourcePlaceholder: ft('i18n_common_static_resource_placeholder', '静态资源占位符')
};

// 属性信息展示卡 - 单条模式
export default {
  name: 'item-block',
  inheritAttrs: false,
  props: {
    item: {
      type: Object,
      default: function () {
        return {
          content: `<p>${LABELS.staticResourcePlaceholder}</p>`,
          data: '',
          label: 'label',
          type: 'list',
          position: 'left',
          slug: '',
          outputJson: {}
        };
      }
    },
    providerData: {
      type: Object,
      default: () => {
        return {
          tableData: []
        };
      }
    },
    mode: {
      type: String,
      default: null
    }
  }
};
</script>

<style lang="scss" scoped>
.label__top {
  span.label {
    display: block;
  }
  span.showdata {
    display: block;
    margin-left: 10px;
  }
}
.label__left {
  span.label {
    display: inline-block;
    width: 120px;
  }
  span.showdata {
    display: inline-block;
    margin-left: 10px;
  }
}

span.showdata a {
  text-decoration: underline;
}
</style>
