@mythpe/quasar-ui-qui 0.3.6 → 0.3.8
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
|
@@ -33,6 +33,7 @@ type P = {
|
|
|
33
33
|
byId?: Props['byId'];
|
|
34
34
|
searchLength?: Props['searchLength'];
|
|
35
35
|
required?: Props['required'];
|
|
36
|
+
multiple?: Props['multiple'];
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
const props = withDefaults(defineProps<P>(), {
|
|
@@ -49,7 +50,8 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
49
50
|
useChoice: undefined,
|
|
50
51
|
byId: undefined,
|
|
51
52
|
searchLength: undefined,
|
|
52
|
-
required: undefined
|
|
53
|
+
required: undefined,
|
|
54
|
+
multiple: undefined
|
|
53
55
|
})
|
|
54
56
|
const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
55
57
|
type Emits = {
|
|
@@ -139,7 +141,9 @@ onMounted(() => {
|
|
|
139
141
|
prepare()
|
|
140
142
|
} else {
|
|
141
143
|
if (fieldValue.value) {
|
|
142
|
-
const id = typeof fieldValue.value !== 'object' ? fieldValue.value :
|
|
144
|
+
const id = typeof fieldValue.value !== 'object' ? fieldValue.value : (
|
|
145
|
+
props.multiple ? fieldValue.value.map((v: any) => v.value) : fieldValue.value.value
|
|
146
|
+
)
|
|
143
147
|
setTimeout(() => {
|
|
144
148
|
prepare(!1, { filter: { id } })
|
|
145
149
|
}, 300)
|
|
@@ -159,6 +163,7 @@ defineOptions({ name: 'MAxios', inheritAttrs: !1 })
|
|
|
159
163
|
v-model:loading="loading"
|
|
160
164
|
v-model:search="search"
|
|
161
165
|
:label="label"
|
|
166
|
+
:multiple="multiple"
|
|
162
167
|
:name="name"
|
|
163
168
|
:options="items"
|
|
164
169
|
:placeholder="placeholder"
|
|
@@ -290,7 +290,28 @@ export const useMyth = () => {
|
|
|
290
290
|
}
|
|
291
291
|
return `${attr} ${value};`
|
|
292
292
|
}
|
|
293
|
+
const dimension = (options?: {
|
|
294
|
+
width?: string | number;
|
|
295
|
+
height?: string | number;
|
|
296
|
+
ratio?: string | number;
|
|
297
|
+
}): number | null => {
|
|
298
|
+
const is = (v: any): v is number | string => v !== undefined && v !== null
|
|
299
|
+
let { width, height, ratio } = options || {}
|
|
300
|
+
ratio = is(ratio) ? (typeof ratio === 'string' ? parseFloat(ratio) : ratio) : undefined
|
|
301
|
+
height = is(height) ? (typeof height === 'string' ? parseFloat(height) : height) : undefined
|
|
302
|
+
width = is(width) ? (typeof width === 'string' ? parseFloat(width) : width) : undefined
|
|
303
|
+
if (is(width) && is(height)) {
|
|
304
|
+
return width / height
|
|
305
|
+
}
|
|
306
|
+
if (is(ratio) && is(height)) {
|
|
307
|
+
return ratio * height
|
|
308
|
+
}
|
|
309
|
+
if (is(ratio) && is(width)) {
|
|
310
|
+
return width / ratio
|
|
311
|
+
}
|
|
293
312
|
|
|
313
|
+
return null
|
|
314
|
+
}
|
|
294
315
|
return {
|
|
295
316
|
__,
|
|
296
317
|
getPageTitle,
|
|
@@ -306,6 +327,7 @@ export const useMyth = () => {
|
|
|
306
327
|
veeRules,
|
|
307
328
|
isSmall,
|
|
308
329
|
colorStyle,
|
|
330
|
+
dimension,
|
|
309
331
|
...plugin
|
|
310
332
|
}
|
|
311
333
|
}
|