<template>
  <div id="app">
    <router-view/>
    <alert v-if='alertState' :data='alertData' @close='destroy'></alert>
  </div>
</template>
<script>
import alert from './components/global/alert/index'
export default {
  components: {
    alert
    //npm install --save echarts echarts-wordcloud particleground-light velocity-animate
  },
  data () {
    return {
      top:0,
      alertState:false,
      alertData:{}
    }
  },
  mounted() {
    this.bus.$on('create',(name,data)=>{
      this.create(name,data)
    })
  },
  methods: {
    //销毁组件，调用此方法请遵从此规则
    destroy(name){
      this[`${name}State`]=false
    },
    create(name,data){
      this[`${name}State`]=true
      this[`${name}Data`]=data
    }
  }
}
</script>

<style>
@import './assets/global/font.css';
@import '//at.alicdn.com/t/font_988027_pm4p4dmbxwe.css';
@import './assets/global/global.css';
body,html{
  padding: 0px;
  margin: 0px;
  font-family:'微软雅黑',' Microsoft YaHei';
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;
}
#app{
  height: 100%;
}
</style>
