@truenewx/tnxvue3 3.0.0-alpha.20 → 3.0.0-alpha.22

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenewx/tnxvue3",
3
- "version": "3.0.0-alpha.20",
3
+ "version": "3.0.0-alpha.22",
4
4
  "description": "互联网技术解决方案:Vue3扩展支持",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -24,7 +24,7 @@
24
24
  "vue-router": "~4.4.0"
25
25
  },
26
26
  "dependencies": {
27
- "@truenewx/tnxcore": "3.0.0-alpha.10",
27
+ "@truenewx/tnxcore": "3.0.0-alpha.11",
28
28
  "@element-plus/icons-vue": "2.3.1",
29
29
  "async-validator": "4.2.5",
30
30
  "mitt": "3.0.1"
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <span v-if="item">{{ item.caption }}</span>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'TnxelEnumView',
8
+ props: {
9
+ type: {
10
+ type: String,
11
+ required: true,
12
+ },
13
+ subtype: String,
14
+ itemKey: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ app: {
19
+ type: String,
20
+ default: () => window.tnx.componentDefaultApp, // 设置为方法以延时加载,确保更改的值生效
21
+ },
22
+ },
23
+ data() {
24
+ return {
25
+ item: null,
26
+ };
27
+ },
28
+ mounted() {
29
+ window.tnx.app.rpc.loadEnumType(this.type, this.subtype, enumType => {
30
+ this.item = enumType.items.find(item => item.key === this.itemKey);
31
+ }, {
32
+ app: this.app,
33
+ });
34
+ },
35
+ methods: {}
36
+ }
37
+ </script>
38
+
39
+ <style scoped>
40
+
41
+ </style>
@@ -147,7 +147,7 @@
147
147
  :title="typeof item.disabled === 'string' ? item.disabled : item.title"
148
148
  v-if="!hiddenValues.contains(item[valueName])">
149
149
  <slot name="option" :item="item" v-if="$slots.option"></slot>
150
- <span v-else>item[textName]</span>
150
+ <span v-else>{{ item[textName] }}</span>
151
151
  </el-option>
152
152
  </template>
153
153
  </el-select>
@@ -21,6 +21,7 @@ import Dialog from './dialog/Dialog.vue';
21
21
  import Drawer from './drawer/Drawer.vue';
22
22
  import DropdownItem from './dropdown-item/DropdownItem.vue';
23
23
  import EnumSelect from './enum-select/EnumSelect.vue';
24
+ import EnumView from './enum-view/EnumView.vue';
24
25
  import FetchCascader from './fetch-cascader/FetchCascader.vue';
25
26
  import FetchSelect from './fetch-select/FetchSelect.vue';
26
27
  import FetchTags from './fetch-tags/FetchTags.vue';
@@ -64,6 +65,7 @@ export default build('tnxel', () => {
64
65
  Drawer,
65
66
  DropdownItem,
66
67
  EnumSelect,
68
+ EnumView,
67
69
  FetchCascader,
68
70
  FetchSelect,
69
71
  FetchTags,