Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
style(ui/uploader): added style(ui/uploader): added bilingual environ…
Browse files Browse the repository at this point in the history
…ment to handleOversize and handleBeforeRead events
  • Loading branch information
ayangweb committed Mar 4, 2022
1 parent 5fd0b4d commit b35cbd0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/varlet-vue2-ui/src/uploader/docs/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default {
methods: {
handleBeforeRead() {
if (file.file.size <= 1 * 1024 * 1024) {
Snackbar.success('the file is less than 1M and can be uploaded')
Snackbar.success('the file is less than 1M, the upload is successful')
return true
} else {
Snackbar.warning('the file is larger than 1M and cannot be uploaded')
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-vue2-ui/src/uploader/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default {
methods: {
handleBeforeRead() {
if (file.file.size <= 1 * 1024 * 1024) {
Snackbar.success('文件小于1M,可以上传')
Snackbar.success('文件小于1M,上传成功')
return true
} else {
Snackbar.warning('文件大于1M,不能上传')
Expand Down
6 changes: 3 additions & 3 deletions packages/varlet-vue2-ui/src/uploader/example/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ export default {
},
handleOversize() {
Snackbar.warning('文件大小超出限制')
Snackbar.warning(this.pack.fileSizeExceedsLimit)
},
handleBeforeRead(file) {
if (file.file.size <= 1 * 1024 * 1024) {
Snackbar.success('文件小于1M,可以上传')
Snackbar.success(this.pack.fileLessThen)
return true
}
Snackbar.warning('文件大于1M,不能上传')
Snackbar.warning(this.pack.fileLargeThen)
return false
},
Expand Down
3 changes: 3 additions & 0 deletions packages/varlet-vue2-ui/src/uploader/example/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ export default {
beforeRemove: 'Remove Preprocessing',
removeTitle: 'Delete or not?',
removeMessage: 'Cannot be withdrawn after deletion',
fileSizeExceedsLimit: 'file size exceeds limit',
fileLessThen: 'the file is less than 1M, the upload is successful',
fileLargeThen: 'the file is larger than 1M and cannot be uploaded',
}
3 changes: 3 additions & 0 deletions packages/varlet-vue2-ui/src/uploader/example/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ export default {
beforeRemove: '删除前处理',
removeTitle: '是否删除?',
removeMessage: '删除后无法撤回',
fileSizeExceedsLimit: '文件大小超出限制',
fileLessThen: '文件小于1M,上传成功',
fileLargeThen: '文件大于1M,不能上传',
}
1 change: 1 addition & 0 deletions packages/varlet-vue2-ui/types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare module 'vue' {
export interface GlobalComponents {
VarActionSheet: typeof import('@varlet-vue2/ui')['_ActionSheetComponent']
VarAppBar: typeof import('@varlet-vue2/ui')['_AppBarComponent']
VarBackTop: typeof import('@varlet-vue2/ui')['_BackTopComponent']
VarBadge: typeof import('@varlet-vue2/ui')['_BadgeComponent']
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-vue2-ui/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { VueConstructor } from 'vue'

export const install: (app: VueConstructor) => void

export * from './actionSheet'
export * from './appBar'
export * from './backTop'
export * from './badge'
Expand Down Expand Up @@ -56,6 +57,5 @@ export * from './tabs'
export * from './tabsItems'
export * from './timePicker'
export * from './uploader'
export * from './actionSheet'
export * from './varComponent'
export * from './varDirective'

0 comments on commit b35cbd0

Please sign in to comment.