diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 9a294289130368816b362917b4821b5df15c359d..c2b39d6d2d2d72393f0c848e9bb7b76c37469fc8 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -14,6 +14,8 @@ ### 🎫 Chores - 更新 antdv 到`2.0.0-rc.2` +- 更新 vue 到`3.0.3` +- 更新 vite 到`1.0.0.rc10` - 暂时删除 `@vueuse/core`.等稳定后在集成。目前不太稳定。 ## 2.0.0-rc.11 (2020-11-18) diff --git a/package.json b/package.json index 8814eed888aeddec6a6741252e28ce3facfd9b13..73f44f72b42a26c6b0b7a0526f611ed5073fd005 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "qrcode": "^1.4.4", "sortablejs": "^1.12.0", "vditor": "^3.6.6", - "vue": "^3.0.2", + "vue": "^3.0.3", "vue-i18n": "^9.0.0-beta.8", "vue-router": "^4.0.0-rc.5", "vuex": "^4.0.0-rc.1", @@ -63,7 +63,7 @@ "@types/zxcvbn": "^4.4.0", "@typescript-eslint/eslint-plugin": "^4.8.2", "@typescript-eslint/parser": "^4.8.2", - "@vue/compiler-sfc": "^3.0.2", + "@vue/compiler-sfc": "^3.0.3", "@vuedx/typecheck": "^0.2.4-0", "@vuedx/typescript-plugin-vue": "^0.2.4-0", "autoprefixer": "^9.8.6", @@ -96,7 +96,7 @@ "tasksfile": "^5.1.1", "ts-node": "^9.0.0", "typescript": "^4.1.2", - "vite": "^1.0.0-rc.9", + "vite": "^1.0.0-rc.10", "vite-plugin-html": "^1.0.0-beta.2", "vite-plugin-mock": "^1.0.6", "vite-plugin-purge-icons": "^0.4.5", diff --git a/src/components/Drawer/src/BasicDrawer.tsx b/src/components/Drawer/src/BasicDrawer.tsx index 9a5bd01ee4aa897bdc9d8607063c2ebe84b24970..b03304f01eaecd0670a1c55f2bb7dc4f756cfef0 100644 --- a/src/components/Drawer/src/BasicDrawer.tsx +++ b/src/components/Drawer/src/BasicDrawer.tsx @@ -1,3 +1,5 @@ +import './index.less'; + import type { DrawerInstance, DrawerProps } from './types'; import { defineComponent, ref, computed, watchEffect, watch, unref, nextTick, toRaw } from 'vue'; @@ -13,8 +15,7 @@ import { getSlot } from '/@/utils/helper/tsxHelper'; import { isFunction, isNumber } from '/@/utils/is'; import { buildUUID } from '/@/utils/uuid'; import { deepMerge } from '/@/utils'; - -import './index.less'; +import { useI18n } from '/@/hooks/web/useI18n'; const prefixCls = 'basic-drawer'; export default defineComponent({ @@ -27,6 +28,8 @@ export default defineComponent({ const visibleRef = ref(false); const propsRef = ref | null>(null); + const { t } = useI18n('component.drawer'); + const getMergeProps = computed((): any => { return deepMerge(toRaw(props), unref(propsRef)); }); @@ -208,7 +211,7 @@ export default defineComponent({ > {getSlot(slots, 'default')} diff --git a/src/components/Drawer/src/props.ts b/src/components/Drawer/src/props.ts index 062ed49559816a1bc4e6ee9ec30a378d796eaf18..19481bc5bd725c7c34908c61e19d64ec95e223ef 100644 --- a/src/components/Drawer/src/props.ts +++ b/src/components/Drawer/src/props.ts @@ -1,4 +1,8 @@ import type { PropType } from 'vue'; + +import { useI18n } from '/@/hooks/web/useI18n'; +const { t } = useI18n('component.drawer'); + export const footerProps = { confirmLoading: Boolean as PropType, /** @@ -11,7 +15,7 @@ export const footerProps = { cancelButtonProps: Object as PropType, cancelText: { type: String as PropType, - default: '关闭', + default: t('cancelText'), }, /** * @description: Show confirmation button @@ -23,7 +27,7 @@ export const footerProps = { okButtonProps: Object as PropType, okText: { type: String as PropType, - default: '确认', + default: t('okText'), }, okType: { type: String as PropType, diff --git a/src/components/Excel/src/ExportExcelModel.vue b/src/components/Excel/src/ExportExcelModel.vue index 10f040d969bfe8cbf0c1a5b567820a0393fd0f37..a17c424511ed9d35141aa30df0f8e77c35992d3d 100644 --- a/src/components/Excel/src/ExportExcelModel.vue +++ b/src/components/Excel/src/ExportExcelModel.vue @@ -1,5 +1,10 @@ diff --git a/src/components/Menu/src/types.ts b/src/components/Menu/src/types.ts index ea7c2d9a7bf0cd76ec1c22d1b4e574991390708d..997120ffbc58a617a3bdae08f402399e89ea2903 100644 --- a/src/components/Menu/src/types.ts +++ b/src/components/Menu/src/types.ts @@ -1,4 +1,6 @@ +import { ComputedRef } from 'vue'; import { ThemeEnum } from '/@/enums/appEnum'; +import { MenuModeEnum } from '/@/enums/menuEnum'; export interface MenuState { // 默认选中的列表 defaultSelectedKeys: string[]; diff --git a/src/components/Modal/src/props.ts b/src/components/Modal/src/props.ts index 43d738f3b0b53ffb1330d957535f8d87e8b6e8fd..3199712dba37fa8ccb8e78541dba5ad902c9ee17 100644 --- a/src/components/Modal/src/props.ts +++ b/src/components/Modal/src/props.ts @@ -1,5 +1,9 @@ import type { PropType } from 'vue'; import { ButtonProps } from 'ant-design-vue/es/button/buttonTypes'; + +import { useI18n } from '/@/hooks/web/useI18n'; +const { t } = useI18n('component.modal'); + export const modalProps = { visible: Boolean as PropType, // open drag @@ -13,11 +17,11 @@ export const modalProps = { }, cancelText: { type: String as PropType, - default: '关闭', + default: t('cancelText'), }, okText: { type: String as PropType, - default: '确认', + default: t('okText'), }, closeFunc: Function as PropType<() => Promise>, }; diff --git a/src/components/Table/src/components/TableSetting.vue b/src/components/Table/src/components/TableSetting.vue index 72b348680d8fafcdb2f1bc568f3d92333150eb36..09701f596782b1c228c6d7f5282baa4f3dda0068 100644 --- a/src/components/Table/src/components/TableSetting.vue +++ b/src/components/Table/src/components/TableSetting.vue @@ -4,27 +4,27 @@ @@ -33,7 +33,7 @@ - 列展示 + {{ t('settingColumnShow') }} - 重置 + {{ t('settingReset') }} @@ -69,7 +69,7 @@ @@ -90,6 +90,7 @@ import { useFullscreen } from '/@/hooks/web/useFullScreen'; import type { SizeType, TableSetting } from '../types/table'; + import { useI18n } from '/@/hooks/web/useI18n'; interface Options { label: string; @@ -139,6 +140,8 @@ defaultCheckList: [], }); + const { t } = useI18n('component.table'); + function init() { let ret: Options[] = []; table.getColumns({ ignoreIndex: true, ignoreAction: true }).forEach((item) => { @@ -217,6 +220,7 @@ reset, getSetting, ...toRefs(state), + t, }; }, }); diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 06f145824aa8b4e630b833fa25f03e2633cf3319..3592e745cc17c854e6cab28a216f23080b65ab14 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -4,7 +4,9 @@ import { unref, ComputedRef, Ref, computed, watchEffect, ref, toRaw } from 'vue' import { isBoolean, isArray, isObject } from '/@/utils/is'; import { PAGE_SIZE } from '../const'; import { useProps } from './useProps'; +import { useI18n } from '/@/hooks/web/useI18n'; +const { t } = useI18n('component.table'); export function useColumns( refProps: ComputedRef, getPaginationRef: ComputedRef @@ -42,7 +44,7 @@ export function useColumns( columns.unshift({ flag: 'INDEX', width: 50, - title: '序号', + title: t('index'), align: 'center', customRender: ({ index }) => { const getPagination = unref(getPaginationRef); diff --git a/src/components/Table/src/hooks/usePagination.tsx b/src/components/Table/src/hooks/usePagination.tsx index 4e67e616049306f2b4862181c4cb990b4dc1c115..94a468b81433c882b9df9eb05b3ac31ac2d66baa 100644 --- a/src/components/Table/src/hooks/usePagination.tsx +++ b/src/components/Table/src/hooks/usePagination.tsx @@ -8,6 +8,9 @@ import { isBoolean } from '/@/utils/is'; import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '../const'; import { useProps } from './useProps'; +import { useI18n } from '/@/hooks/web/useI18n'; + +const { t } = useI18n('component.table'); export function usePagination(refProps: ComputedRef) { const configRef = ref({}); const { propsRef } = useProps(refProps); @@ -22,7 +25,7 @@ export function usePagination(refProps: ComputedRef) { pageSize: PAGE_SIZE, size: 'small', defaultPageSize: PAGE_SIZE, - showTotal: (total) => `共 ${total} 条数据`, + showTotal: (total) => t('total', { total }), showSizeChanger: true, pageSizeOptions: PAGE_SIZE_OPTIONS, itemRender: ({ page, type, originalElement }) => { diff --git a/src/components/Tinymce/src/lineHeight.ts b/src/components/Tinymce/src/lineHeight.ts index 6d7c25035fae43feda086c44974d7316fee2c259..82f6626a892a6ce03195cfc96c7bcb0af9f68b86 100644 --- a/src/components/Tinymce/src/lineHeight.ts +++ b/src/components/Tinymce/src/lineHeight.ts @@ -13,7 +13,7 @@ const lineHeight = function (tinymce: any) { t.ui.registry.addMenuButton('lineheight', { icon: 'lineheight', - tooltip: '设置行高', + tooltip: 'Line Height', // fetch: function (callback: Fn) { // var dom = t.dom; // var blocks = t.selection.getSelectedBlocks(); diff --git a/src/components/Upload/src/BasicUpload.vue b/src/components/Upload/src/BasicUpload.vue index d28f69f0012e57ea434235e9ea4d45e2709d45bd..9b556a7667300c21aeb9924af340a6f0425266c6 100644 --- a/src/components/Upload/src/BasicUpload.vue +++ b/src/components/Upload/src/BasicUpload.vue @@ -2,11 +2,11 @@
- 上传 + {{ t('upload') }} @@ -39,12 +39,14 @@ import { uploadContainerProps } from './props'; import { omit } from 'lodash-es'; + import { useI18n } from '/@/hooks/web/useI18n'; export default defineComponent({ name: 'BasicUpload', components: { UploadModal, UploadPreviewModal, Icon, Tooltip }, props: uploadContainerProps, setup(props, { emit, attrs }) { + const { t } = useI18n('component.upload'); // 上传modal const [registerUploadModal, { openModal: openUploadModal }] = useModal(); @@ -94,6 +96,7 @@ fileListRef, showPreview, bindValue, + t, }; }, }); diff --git a/src/components/Upload/src/UploadModal.vue b/src/components/Upload/src/UploadModal.vue index d580326284de7f2926f8c4d4f5dafae7e146a11a..dafce662df5b8ef02202b15604cc0ac4592d9821 100644 --- a/src/components/Upload/src/UploadModal.vue +++ b/src/components/Upload/src/UploadModal.vue @@ -1,8 +1,8 @@