quasar-ui-danx 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -57,7 +57,9 @@
|
|
57
57
|
>
|
58
58
|
<RenderComponent
|
59
59
|
v-if="rowProps.col.component"
|
60
|
-
:
|
60
|
+
:params="[rowProps.row]"
|
61
|
+
:component="rowProps.col.component"
|
62
|
+
:text="rowProps.value"
|
61
63
|
@action="$emit('action', $event)"
|
62
64
|
/>
|
63
65
|
<div v-else-if="rowProps.col.fieldList">
|
@@ -1,22 +1,37 @@
|
|
1
1
|
<template>
|
2
2
|
<Component
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
>{{
|
3
|
+
:is="resolvedComponent.is"
|
4
|
+
v-bind="{...resolvedComponent.props, ...overrideProps}"
|
5
|
+
@action="$emit('action', $event)"
|
6
|
+
>{{ resolvedComponent.value || resolvedComponent.props?.text || text }}</Component>
|
7
7
|
</template>
|
8
8
|
<script setup>
|
9
|
-
import { computed } from
|
9
|
+
import { computed } from 'vue';
|
10
10
|
|
11
|
-
defineEmits([
|
11
|
+
defineEmits(['action']);
|
12
12
|
const props = defineProps({
|
13
|
-
|
14
|
-
type: Object,
|
13
|
+
component: {
|
14
|
+
type: [Function, Object],
|
15
15
|
required: true
|
16
|
+
},
|
17
|
+
params: {
|
18
|
+
type: Array,
|
19
|
+
default: () => []
|
20
|
+
},
|
21
|
+
text: {
|
22
|
+
type: String,
|
23
|
+
default: ''
|
24
|
+
},
|
25
|
+
overrideProps: {
|
26
|
+
type: Object,
|
27
|
+
default: () => ({})
|
16
28
|
}
|
17
29
|
});
|
18
30
|
|
19
|
-
const
|
20
|
-
|
31
|
+
const resolvedComponent = computed(() => {
|
32
|
+
if (typeof props.component === 'function') {
|
33
|
+
return props.component(...props.params);
|
34
|
+
}
|
35
|
+
return props.component;
|
21
36
|
});
|
22
37
|
</script>
|