feat: add action i18n

pull/1/MERGE
xingyuv 2023-03-22 11:41:35 +08:00
parent 60d43c077c
commit 9782e6a6fd
3 changed files with 10 additions and 1 deletions

View File

@ -15,11 +15,12 @@
</template>
<Dropdown :trigger="['hover']" :dropMenuList="getDropdownList" popconfirm v-if="dropDownActions && getDropdownList.length > 0">
<slot name="more"></slot>
<a-button type="link" v-if="!$slots.more"> <MoreOutlined class="icon-more" /> </a-button>
<a-button type="link" v-if="!$slots.more"> <MoreOutlined class="icon-more" />{{ t('action.more') }} </a-button>
</Dropdown>
</div>
</template>
<script lang="ts" setup name="TableAction">
import { useI18n } from '@/hooks/web/useI18n'
import { computed, toRaw, unref } from 'vue'
import { MoreOutlined } from '@ant-design/icons-vue'
import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'
@ -48,6 +49,7 @@ const props = defineProps({
stopButtonPropagation: propTypes.bool.def(false)
})
const { t } = useI18n()
const { prefixCls } = useDesign('basic-table-action')
let table: Partial<TableActionType> = {}
if (!props.outside) {
@ -166,6 +168,11 @@ function onCellClick(e: MouseEvent) {
}
}
.ant-btn-link {
margin-left: 0;
padding: 8px 4px;
}
.ant-divider,
.ant-divider-vertical {
margin: 0 2px;

View File

@ -1,4 +1,5 @@
export default {
more: 'more',
create: 'Create',
edit: 'Edit',
test: 'Test',

View File

@ -1,4 +1,5 @@
export default {
more: '更多',
create: '新增',
edit: '修改',
test: '测试',