Fix reactivity for props.
This commit is contained in:
parent
7f52ffe45f
commit
5ff51f03ae
|
@ -1,14 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, defineProps} from "vue";
|
import {computed, defineProps} from "vue";
|
||||||
|
|
||||||
const {
|
const props = defineProps({
|
||||||
title,
|
|
||||||
icon,
|
|
||||||
variant,
|
|
||||||
value,
|
|
||||||
link,
|
|
||||||
filter,
|
|
||||||
} = defineProps({
|
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -36,11 +29,11 @@ const {
|
||||||
});
|
});
|
||||||
|
|
||||||
const linkTarget = computed(() => {
|
const linkTarget = computed(() => {
|
||||||
if (filter) {
|
if (props.filter) {
|
||||||
const json = JSON.stringify(filter);
|
const json = JSON.stringify(props.filter);
|
||||||
return `${link}?search=${encodeURIComponent(json)}`;
|
return `${props.link}?search=${encodeURIComponent(json)}`;
|
||||||
} else {
|
} else {
|
||||||
return link;
|
return props.link;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue