mooho-base-admin-plus 0.4.5 → 0.4.6

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "0.4.5",
4
+ "version": "0.4.6",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "dotnetVersion": "1.4.0",
7
7
  "license": "MIT",
@@ -46,13 +46,13 @@ const service = axios.create({
46
46
  // 解析多语言带参数
47
47
  const tParam = str => {
48
48
  let array = str.split('|');
49
- let result = window.$t(array[0]);
49
+ let key = array[0];
50
+ array.shift();
50
51
 
51
- if (array.length > 1) {
52
- for (let i = 0; i < array.length - 1; i++) {
53
- result = result.replace('[' + i + ']', array[i + 1]);
54
- result = result.replace('{' + i + '}', window.$t('Model_' + array[i + 1]));
55
- }
52
+ let result = window.$t(key, array);
53
+
54
+ for (let i = 0; i < array.length; i++) {
55
+ result = result.replace('[' + i + ']', array[i]);
56
56
  }
57
57
 
58
58
  return result;
@@ -703,17 +703,11 @@ export default {
703
703
  },
704
704
  // 解析多语言带参数
705
705
  tParam(str) {
706
- console.log('str', str);
707
706
  let array = str.split('|');
708
- let result = this.$t(array[0]);
707
+ let key = array[0];
708
+ array.shift();
709
709
 
710
- if (array.length > 1) {
711
- for (let i = 0; i < array.length - 1; i++) {
712
- result = result.replace('[' + i + ']', array[i + 1]);
713
- }
714
- }
715
-
716
- return result;
710
+ return this.$t(key, array);
717
711
  }
718
712
  }
719
713
  };