kz-ui-base 1.0.151 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
size="small"
|
|
23
23
|
type="primary"
|
|
24
24
|
@click="handleConfirm"
|
|
25
|
-
>{{
|
|
25
|
+
>{{ confirmText }}
|
|
26
26
|
</el-button>
|
|
27
27
|
<el-button
|
|
28
28
|
size="small"
|
|
29
29
|
@click="handleClose"
|
|
30
|
-
>{{
|
|
30
|
+
>{{ cancelText }}
|
|
31
31
|
</el-button>
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
@@ -44,11 +44,11 @@ export default {
|
|
|
44
44
|
},
|
|
45
45
|
confirmText: {
|
|
46
46
|
type: String,
|
|
47
|
-
default: ''
|
|
47
|
+
default: '确定'
|
|
48
48
|
},
|
|
49
49
|
cancelText: {
|
|
50
50
|
type: String,
|
|
51
|
-
default: ''
|
|
51
|
+
default: '关闭'
|
|
52
52
|
},
|
|
53
53
|
visible: {
|
|
54
54
|
type: Boolean,
|
|
@@ -66,25 +66,12 @@ export default {
|
|
|
66
66
|
submitLoading: false
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
computed: {
|
|
70
|
-
// 确定按钮文本,支持国际化
|
|
71
|
-
_confirmText() {
|
|
72
|
-
return this.confirmText || this.t('component.dialog.confirm') || '确定'
|
|
73
|
-
},
|
|
74
|
-
// 取消按钮文本,支持国际化
|
|
75
|
-
_cancelText() {
|
|
76
|
-
return this.cancelText || this.t('component.dialog.cancel') || '关闭'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
69
|
watch: {
|
|
80
70
|
visible(val) {
|
|
81
71
|
this.modalState = val
|
|
82
72
|
}
|
|
83
73
|
},
|
|
84
74
|
methods: {
|
|
85
|
-
t(key) {
|
|
86
|
-
return this.$t(key) || key
|
|
87
|
-
},
|
|
88
75
|
handleConfirm() {
|
|
89
76
|
this.$emit('on-confirm')
|
|
90
77
|
},
|
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
|
-
import zhCN from "element-ui/lib/locale/lang/zh-CN";
|
|
3
|
-
import enUS from "element-ui/lib/locale/lang/en";
|
|
4
|
-
import ElementLocale from "element-ui/lib/locale";
|
|
5
|
-
|
|
6
|
-
// 根据当前语言设置配置 Element UI 语言
|
|
7
|
-
function initElementLocale() {
|
|
8
|
-
const currentLocale = localStorage.getItem("locale") || "zh_CN";
|
|
9
|
-
if (currentLocale === "en_US") {
|
|
10
|
-
ElementLocale.use(enUS);
|
|
11
|
-
} else {
|
|
12
|
-
ElementLocale.use(zhCN);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// 初始化 Element UI 语言
|
|
17
|
-
initElementLocale();
|
|
18
2
|
|
|
19
3
|
function makeDialog(option) {
|
|
20
|
-
// 每次创建对话框时重新初始化语言
|
|
21
|
-
initElementLocale();
|
|
22
4
|
var dom = document.createElement("div");
|
|
23
5
|
document.getElementsByTagName("body")[0].appendChild(dom);
|
|
24
6
|
let tpl =
|
|
@@ -129,8 +111,6 @@ function makeDialog(option) {
|
|
|
129
111
|
return vue;
|
|
130
112
|
}
|
|
131
113
|
function makeDrawer(option) {
|
|
132
|
-
// 每次创建抽屉时重新初始化语言
|
|
133
|
-
initElementLocale();
|
|
134
114
|
var dom = document.createElement("div");
|
|
135
115
|
document.getElementsByTagName("body")[0].appendChild(dom);
|
|
136
116
|
let tpl =
|