<template>

  <div class="preview-main">
      <component v-for="(item,index) in currentObj.fields"
                :key="index"
                :is="item.type"
                v-bind="item.props"
                ></component>
  </div>

</template>

<script type="text/babel">

  import { Core,Component } from 'eye-core';

  import SeeService from './service/see'

  export default Component({

    name: 'see-priview',

    props: {
        options: {
            type: Object,
            default:()=>{
                return {
                    fields:[]
                }
            }
        }
    },
    
    // 方便管理各个组件的状态
    services: [ SeeService ],

    data(){
        return {
            // 清理过之后的数据
            currentObj: {}
        }
    },

    onInit() {
        this.currentObj = this.$service.see.initData(this.options)
    },

    methods:{}

  });

</script>










