<template>
  <div v-if="">
    <el-button v-if="!showFloatDrawer" class="dev-assistant-btn" type="primary" @click="showFloatDrawer = true">Pro<i
      class="el-icon-plus"></i></el-button>
    <el-drawer
      :withHeader="false"
      title="Pro+助手"
      :visible.sync="showFloatDrawer"
      direction="rtl"
      size="760px">
      <iframe src="http://localhost:3000/generator/" width="100%" height="100%"></iframe>
    </el-drawer>
  </div>

</template>

<script>

export default {
  name: 'FloatDrawer',
  data() {
    return {
      showAssistant: false,
      showFloatDrawer: false
    }
  },
  props: {
    env: String
  },
  created() {
    console.log('环境变量', process.env.VUE_APP_ENV)
    if ((process && process.env && (process.env.NODE_ENV === 'development' || process.env.VUE_APP_ENV === 'local')) || this.env === 'local') {
      this.showAssistant = true
    }
  }
}
</script>

<style lang="scss" scoped>
  .dev-assistant-btn {
    padding: 15px 9px;
    position: fixed;
    right: -5px;
    top: 50%;
    z-index: 9999;
  }
</style>
