@hostlink/nuxt-light 1.46.3 → 1.46.5
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/dist/module.json
CHANGED
|
@@ -21,13 +21,23 @@ function getTo(field) {
|
|
|
21
21
|
}
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
+
const getFormattedValue = (field, model) => {
|
|
25
|
+
let val = model ? model[field.name] : null;
|
|
26
|
+
if (field.format) {
|
|
27
|
+
if (field.format instanceof Function) {
|
|
28
|
+
return field.format(val, model);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
;
|
|
32
|
+
return val;
|
|
33
|
+
};
|
|
24
34
|
</script>
|
|
25
35
|
|
|
26
36
|
<template>
|
|
27
37
|
<q-list v-bind="$props">
|
|
28
38
|
<template v-if="fields">
|
|
29
39
|
<l-item v-for="field in fields" :label="field.label" :to="getTo(field)">
|
|
30
|
-
{{
|
|
40
|
+
{{ getFormattedValue(field, props.modelValue) }}
|
|
31
41
|
</l-item>
|
|
32
42
|
|
|
33
43
|
</template>
|