<template>
  <div>
    <template v-for="extend in UIExtends">
      <component :is="extend"  :content.sync="curContent" :key="'key_'+extend" @callback="showPanel"></component>
    </template>
  </div>
</template>
<script>
import DimensionsExtend from '../../contentadvance/components/ContentEditorExtendAction.vue'
import ModelContentExtend from '../../contentextend/components/ContentEditorExtendAction.vue'
import BrowseprivContentExtend from '../../browsepriv/components/ContentEditorExtendAction.vue'
import CommonDimensionsExtend from '../../workspace/components/ContentEditorExtendAction.vue'
export default {
  data() {
    return {
      UIExtends: ['dimensions-extend', 'model-extend', 'browsepriv-extend', 'common-demensions-extend']
    }
  },
  components: {
    'dimensions-extend': DimensionsExtend,
    'model-extend': ModelContentExtend,
    'browsepriv-extend': BrowseprivContentExtend,
    'common-demensions-extend': CommonDimensionsExtend
  },
  props: {
    content: {
      type: Object,
      default: function() {
        return {}
      }
    },
    isCustomEdit: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    curContent: {
      get() {
        return this.content
      },
      set(val) {
        this.$emit('update:content', val)
      }
    }
  },
  methods: {
    showPanel() {
      this.$emit('callback')
    }
  }
}
</script>
