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