@zscreate/zhxy-app-component 1.0.90 → 1.0.91

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.
@@ -1159,11 +1159,19 @@ export default {
1159
1159
  if (this.widget.options.disabled) {
1160
1160
  return false
1161
1161
  } else {
1162
+ const { multiple } = this.widget.options
1162
1163
  var optionsData = JSON.stringify(this.widget.options)
1163
1164
  var PubsubSign = String(Math.random()).split('.')[1];
1164
1165
  Pubsub.subscribe(PubsubSign, (msg, data) => {
1165
1166
  console.log(data)
1166
- this.dataModel = data.map(item => item.value)
1167
+ // this.dataModel = data.map(item => item.value)
1168
+
1169
+ const value = data.map(item => item.value) || []
1170
+ if (multiple) {
1171
+ this.dataModel = value
1172
+ } else {
1173
+ value.length > 0 ? this.dataModel = value[0] : null
1174
+ }
1167
1175
 
1168
1176
  if (!data || !Array.isArray(data) || data.length == 0) {
1169
1177
  this.dataModel = ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/zhxy-app-component",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
4
4
  "private": false,
5
5
  "description": "zhxy-app-component",
6
6
  "main": "index.js",