@hostlink/nuxt-light 1.8.4 → 1.8.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
|
@@ -1,54 +1,44 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import { useSlots, computed, ref } from 'vue';
|
|
2
|
+
import { useSlots } from 'vue';
|
|
4
3
|
import type { QTabsProps } from 'quasar';
|
|
5
4
|
|
|
5
|
+
const model = defineModel<string | number | null | undefined>()
|
|
6
6
|
interface LTabsProps extends QTabsProps {
|
|
7
7
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const emit = defineEmits(["update:modelValue"])
|
|
10
|
+
defineProps<LTabsProps>()
|
|
11
|
+
|
|
13
12
|
const slots = useSlots();
|
|
14
|
-
const defaultSlots = slots.default()
|
|
13
|
+
const defaultSlots = slots.default ? slots.default() : []
|
|
15
14
|
|
|
16
15
|
//get the tabs from the default slot
|
|
17
16
|
let name = 0;
|
|
18
17
|
const tabContents = defaultSlots.map((slot) => {
|
|
19
|
-
const n = slot.props
|
|
18
|
+
const n = slot.props?.name || name++;
|
|
20
19
|
return {
|
|
21
|
-
label: slot.props
|
|
20
|
+
label: slot.props?.label,
|
|
22
21
|
content: slot.children,
|
|
23
22
|
name: n.toString()
|
|
24
23
|
}
|
|
25
24
|
})
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
v.value = tabContents[0].name
|
|
31
|
-
}
|
|
32
|
-
const localValue = computed({
|
|
33
|
-
get: () => props.modelValue || v.value,
|
|
34
|
-
set: (val) => {
|
|
35
|
-
v.value = val
|
|
36
|
-
emit("update:modelValue", val)
|
|
26
|
+
if (model.value === null || model.value === undefined) {
|
|
27
|
+
if (tabContents.length > 0) {
|
|
28
|
+
model.value = tabContents[0].name
|
|
37
29
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
}
|
|
41
31
|
|
|
42
32
|
</script>
|
|
43
33
|
|
|
44
34
|
<template>
|
|
45
35
|
<l-card>
|
|
46
36
|
<q-tabs class="text-grey" :active-color="$light.color" :indicator-color="$light.color" align="justify"
|
|
47
|
-
v-model="
|
|
37
|
+
v-model="model">
|
|
48
38
|
<q-tab v-for="tab in tabContents" :label="$t(tab.label)" :name="tab.name"></q-tab>
|
|
49
39
|
</q-tabs>
|
|
50
|
-
<q-tab-panels v-model="
|
|
51
|
-
<
|
|
40
|
+
<q-tab-panels v-model="model">
|
|
41
|
+
<component v-for="tab in tabContents" :key="tab.name" :is="tab.content?.default" :name="tab.name" />
|
|
52
42
|
</q-tab-panels>
|
|
53
43
|
</l-card>
|
|
54
44
|
</template>
|
|
@@ -62,8 +62,8 @@ eventLogCols.forEach(col => {
|
|
|
62
62
|
</q-card-section>
|
|
63
63
|
|
|
64
64
|
<q-card-section class="text-center text-center q-pt-none">
|
|
65
|
-
<q-chip v-for="role in my.roles" :key="role" :label="role" :color="$light.color"
|
|
66
|
-
class="q-ma-xs" />
|
|
65
|
+
<q-chip v-for="role in my.roles" :key="role" :label="role" :color="$light.color"
|
|
66
|
+
text-color="white" class="q-ma-xs" />
|
|
67
67
|
</q-card-section>
|
|
68
68
|
|
|
69
69
|
|
|
@@ -85,11 +85,13 @@ eventLogCols.forEach(col => {
|
|
|
85
85
|
|
|
86
86
|
<l-tabs>
|
|
87
87
|
<l-tab label="User Log">
|
|
88
|
-
<l-table :rows="my.userLog.data" :columns="userlogColumns" searchable
|
|
88
|
+
<l-table :rows="my.userLog.data" :columns="userlogColumns" searchable
|
|
89
|
+
:rows-per-page-options="[0]">
|
|
89
90
|
</l-table>
|
|
90
91
|
</l-tab>
|
|
91
92
|
<l-tab label="Event Log">
|
|
92
|
-
<l-table :rows="my.eventLog.data" :columns="eventLogCols" searchable
|
|
93
|
+
<l-table :rows="my.eventLog.data" :columns="eventLogCols" searchable
|
|
94
|
+
:rows-per-page-options="[0]">
|
|
93
95
|
</l-table>
|
|
94
96
|
</l-tab>
|
|
95
97
|
|