|
|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
<div class="app-operation">
|
|
|
<template v-for="(item, index) in dataList" :key="index">
|
|
|
- <el-button :class="item.className" :size="size" :icon="item[defaultProps.icon]" :circle="circle" plain
|
|
|
- @click="onClick(item[defaultProps.value])">
|
|
|
+ <el-button :class="item.className" :title="t('routes.' + item[defaultProps.value])" :size="size"
|
|
|
+ :icon="item[defaultProps.icon]" :circle="circle" plain @click="onClick(item[defaultProps.value])">
|
|
|
<slot :item="item" v-if="!circle">
|
|
|
- {{ $t('routes.'+item[defaultProps.value]) }}
|
|
|
+ {{ t('routes.' + item[defaultProps.value]) }}
|
|
|
</slot>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
@@ -13,6 +13,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import { PropType, computed } from 'vue'
|
|
|
+import { i18n } from '@/stores'
|
|
|
|
|
|
const props = defineProps({
|
|
|
dataList: {
|
|
|
@@ -37,6 +38,7 @@ const props = defineProps({
|
|
|
})
|
|
|
|
|
|
const emit = defineEmits(['click'])
|
|
|
+const t = i18n.global.t
|
|
|
|
|
|
const defaultProps = computed(() => {
|
|
|
const { label = 'title', value = 'resourceCode', icon = 'icon' } = props.props ?? {}
|