js-kompo-utils 1.0.23 → 1.0.24
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/components/VlSelect.vue +13 -4
- package/package.json +1 -1
package/components/VlSelect.vue
CHANGED
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
return this.panelStyle
|
|
86
86
|
},
|
|
87
87
|
useNativeMobile() {
|
|
88
|
-
if (this.$_config('
|
|
88
|
+
if (!this.$_config('native_on_mobile')) return false
|
|
89
89
|
return this.isTouchDevice && !this.$_multiple && !this.ajaxOptions
|
|
90
90
|
},
|
|
91
91
|
nativeValue() {
|
|
@@ -141,9 +141,18 @@ export default {
|
|
|
141
141
|
},
|
|
142
142
|
nativeLabel(opt) {
|
|
143
143
|
const l = opt.label
|
|
144
|
-
|
|
145
|
-
if (
|
|
146
|
-
|
|
144
|
+
let raw = ''
|
|
145
|
+
if (typeof l === 'string') raw = l
|
|
146
|
+
else if (l && typeof l === 'object') raw = l.label || l.text || l.search || ''
|
|
147
|
+
else raw = String(opt.value ?? '')
|
|
148
|
+
return this.stripHtml(raw)
|
|
149
|
+
},
|
|
150
|
+
stripHtml(str) {
|
|
151
|
+
if (!str || typeof str !== 'string') return ''
|
|
152
|
+
if (str.indexOf('<') === -1) return str
|
|
153
|
+
const tmp = document.createElement('div')
|
|
154
|
+
tmp.innerHTML = str
|
|
155
|
+
return (tmp.textContent || tmp.innerText || '').trim()
|
|
147
156
|
},
|
|
148
157
|
teleportOptions() {
|
|
149
158
|
const opts = this.$refs.selectOptions
|