feat: add action i18n
parent
60d43c077c
commit
9782e6a6fd
|
|
@ -15,11 +15,12 @@
|
||||||
</template>
|
</template>
|
||||||
<Dropdown :trigger="['hover']" :dropMenuList="getDropdownList" popconfirm v-if="dropDownActions && getDropdownList.length > 0">
|
<Dropdown :trigger="['hover']" :dropMenuList="getDropdownList" popconfirm v-if="dropDownActions && getDropdownList.length > 0">
|
||||||
<slot name="more"></slot>
|
<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>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="TableAction">
|
<script lang="ts" setup name="TableAction">
|
||||||
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { computed, toRaw, unref } from 'vue'
|
import { computed, toRaw, unref } from 'vue'
|
||||||
import { MoreOutlined } from '@ant-design/icons-vue'
|
import { MoreOutlined } from '@ant-design/icons-vue'
|
||||||
import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'
|
import { Divider, Tooltip, TooltipProps } from 'ant-design-vue'
|
||||||
|
|
@ -48,6 +49,7 @@ const props = defineProps({
|
||||||
stopButtonPropagation: propTypes.bool.def(false)
|
stopButtonPropagation: propTypes.bool.def(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
const { prefixCls } = useDesign('basic-table-action')
|
const { prefixCls } = useDesign('basic-table-action')
|
||||||
let table: Partial<TableActionType> = {}
|
let table: Partial<TableActionType> = {}
|
||||||
if (!props.outside) {
|
if (!props.outside) {
|
||||||
|
|
@ -166,6 +168,11 @@ function onCellClick(e: MouseEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-btn-link {
|
||||||
|
margin-left: 0;
|
||||||
|
padding: 8px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-divider,
|
.ant-divider,
|
||||||
.ant-divider-vertical {
|
.ant-divider-vertical {
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
|
more: 'more',
|
||||||
create: 'Create',
|
create: 'Create',
|
||||||
edit: 'Edit',
|
edit: 'Edit',
|
||||||
test: 'Test',
|
test: 'Test',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
export default {
|
export default {
|
||||||
|
more: '更多',
|
||||||
create: '新增',
|
create: '新增',
|
||||||
edit: '修改',
|
edit: '修改',
|
||||||
test: '测试',
|
test: '测试',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue