<template>
  <div>
    <button @click="openmodel()">测试按钮</button>  <button @click="loadData()">加载数据</button>
    <div class="relLayout">
      <gaea-editor ref="editor"></gaea-editor>
    </div>

  </div>
</template>

<script>
    import eventbus from '../../../../myPlugin/page-ide/lib/service/eventbus';
    export default {
        methods:{
            loadData(){
                eventbus.$emit("showTemplateType",{
                    type:'add'});
            },
            openmodel(){

                this.$store.commit('viewport/deleteDataArr', {});
                let sth=this.$refs.editor.exportData(1);
                console.log(JSON.stringify(sth));
                Bus.$emit("initTemplateInstance",{});
                //let sth=this.$refs.editor.exportData(2);

            }
        },
        created(){
            Bus.$on("initTemplateInstance",function(){
                debugger;
            });
        },mounted(){
            this.$refs.editor.updateHeight("100px");
        }

    };
</script>

<style scoped lang="less">
  .relLayout{

  }
  .iTDNZh {
    position: absolute;
    left: 0px;
    top:40px;
    overflow: hidden !important;
  }
  .hkgySY {
    min-height: 400px !important;
  }
  .attachment-wrap .attachment {
    line-height: 10px !important;
  }
  .attachment-wrap .attachment .title {
    overflow: hidden !important;
  }
</style>
