doum
2025-09-26 9057e04efad1b7d61c77a72e5c37a504d0aee935
admin/src/components/common/ImportButton.vue
对比新文件
@@ -0,0 +1,37 @@
<template>
  <div class="import-button">
    <el-button @click="$refs.importWindow.open(text)">{{text}}</el-button>
    <ImportWindow :action="action" :template-path="templatePath" :template-name="templateName" ref="importWindow" @success="handleSuccess"/>
  </div>
</template>
<script>
import ImportWindow from './ImportWindow'
export default {
  name: 'ImportButton',
  components: { ImportWindow },
  props: {
    // 鎸夐挳鏂囨
    text: {
      default: '瀵煎叆'
    },
    // 妯$増鍦板潃
    templatePath: {
      required: true
    },
    // 涓嬭浇鍚庣殑妯$増鏂囦欢鍚嶇О
    templateName: {
      required: true
    },
    // 瀵煎叆鎺ュ彛鍦板潃
    action: {
      required: true
    }
  },
  methods: {
    handleSuccess () {
      this.$emit('success')
    }
  }
}
</script>