<template>
  <span>
    <el-tooltip :content="content" placement="top">
      <a @click="showDialog=true" class="tips-icon"><i class="el-icon-view el-icon-question"></i></a>
    </el-tooltip>
    <scriptDescriptionDialog :path="path" v-if="showDialog"
                             :visiable.sync="showDialog"></scriptDescriptionDialog>
  </span>
</template>
<script>

export default {
  name: "scriptDescriptionButton",
  components: {scriptDescriptionDialog:() => import('../../components/scriptDescription/dialog')},
  props: {
    path: String,
    title: String
  },
  computed: {
    content() {
      return this.title || this.$t2('脚本说明', 'components.scriptDescription.title');
    },
  },
  data() {
    return {
      showDialog: false
    }
  }
}
</script>

<style scoped>

</style>
