<script>
import CommonList from './commonList'
import { buttonConfigGlobals, commonConfigGlobals, configGlobals } from './configGlobal'
console.log(buttonConfigGlobals)
export default {
  name: 'V2CommonList',
  components: { CommonList },
  props: {
    buttonConfigGlobalsProps: {
      type: Object,
      default: () => ({})
    },
    commonConfigGlobalsProps: {
      type: Object,
      default: () => ({})
    },
    configGlobalsProps: {
      type: Object,
      default: () => ({})
    }
  },
  mounted() {
    Object.assign(buttonConfigGlobals, this.buttonConfigGlobalsProps)
    Object.assign(commonConfigGlobals, this.commonConfigGlobalsProps)
    Object.assign(configGlobals, this.configGlobalsProps)
  },
  methods: {
    getList() {
      this.$refs.commonListRef && this.$refs.commonListRef.getList()
    },
    getData() {
      return this.$refs.commonListRef && this.$refs.commonListRef.getData()
    }
  },
  render() {
    const attrs = this.$attrs
    return (
      <div>
        <CommonList {...{ attrs }} ref='commonListRef'>
          <template slot='default'>{ this.$slots.default }</template>
          <template slot='top'>{ this.$slots.top }</template>
          <template slot='header'>{ this.$slots.header }</template>
          <template slot='footer'>{ this.$slots.footer }</template>
        </CommonList>
      </div>
    )
  }
}
</script>
