@hostlink/nuxt-light 1.26.0 → 1.26.1
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 +1 -1
- package/dist/runtime/components/MyTest.vue +10 -0
- package/dist/runtime/components/l-table.vue +5 -3
- package/dist/runtime/lib/defineLightModel.d.ts +3 -0
- package/dist/runtime/pages/User/index.vue +1 -1
- package/dist/runtime/types/User.d.ts +7 -0
- package/dist/runtime/types/User.js +10 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -354,7 +354,7 @@ const onLocalRequest = async (p: any) => {
|
|
|
354
354
|
color: "negative"
|
|
355
355
|
})
|
|
356
356
|
this.setData({ data: [], meta: { total: 0, key: "", name: "" } });
|
|
357
|
-
|
|
357
|
+
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
}
|
|
@@ -550,7 +550,8 @@ const onAdd = () => {
|
|
|
550
550
|
v-model:minimized="minimized" v-model:maximized="maximized">
|
|
551
551
|
|
|
552
552
|
<q-toolbar v-if="addComponent">
|
|
553
|
-
<q-btn icon="sym_o_add" :label="$t('Add')" :color="$light.color" @click="onAdd" v-if="addComponent"
|
|
553
|
+
<q-btn icon="sym_o_add" :label="$t('Add')" :color="$light.color" @click="onAdd" v-if="addComponent"
|
|
554
|
+
outline />
|
|
554
555
|
</q-toolbar>
|
|
555
556
|
|
|
556
557
|
|
|
@@ -619,7 +620,8 @@ const onAdd = () => {
|
|
|
619
620
|
<l-link :to="col.to(props.row)">{{ col.value }}</l-link>
|
|
620
621
|
</template>
|
|
621
622
|
<template v-else-if="col.component">
|
|
622
|
-
<component :is="col.component" v-model="props.row"
|
|
623
|
+
<component :is="col.component" v-model="props.row"
|
|
624
|
+
v-bind="col.componentProps ? col.componentProps(props.row) : null" />
|
|
623
625
|
</template>
|
|
624
626
|
<template v-else>
|
|
625
627
|
{{ col.value }}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
1
2
|
export interface LightModelGqlField {
|
|
2
3
|
[key: string]: string | LightModelGqlField | boolean;
|
|
3
4
|
}
|
|
@@ -11,6 +12,8 @@ export interface LightModelField {
|
|
|
11
12
|
gqlField?: LightModelGqlField;
|
|
12
13
|
to?: (row: any) => string;
|
|
13
14
|
field?: (row: any) => string;
|
|
15
|
+
component?: Component;
|
|
16
|
+
componentProps?: any;
|
|
14
17
|
}
|
|
15
18
|
export interface LightModelFields {
|
|
16
19
|
[key: string]: LightModelField;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import MyTest from "../components/MyTest.vue";
|
|
1
2
|
export default {
|
|
2
3
|
username: {
|
|
3
4
|
label: "Username",
|
|
@@ -62,5 +63,14 @@ export default {
|
|
|
62
63
|
format: (value) => {
|
|
63
64
|
return value ? "Yes" : "No";
|
|
64
65
|
}
|
|
66
|
+
},
|
|
67
|
+
_test: {
|
|
68
|
+
label: "Test",
|
|
69
|
+
component: MyTest,
|
|
70
|
+
componentProps: (a) => {
|
|
71
|
+
return {
|
|
72
|
+
test: a.username
|
|
73
|
+
};
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
};
|