refactor(VnCard): use prop.url when init
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
519ae66226
commit
95950b7485
|
@ -26,7 +26,7 @@ const route = useRoute();
|
||||||
const stateStore = useStateStore();
|
const stateStore = useStateStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const entityId = computed(() => props.id || route?.params?.id);
|
const entityId = computed(() => props.id || route?.params?.id);
|
||||||
let arrayData = getArrayData();
|
let arrayData = getArrayData(props.url);
|
||||||
|
|
||||||
onBeforeRouteLeave(() => {
|
onBeforeRouteLeave(() => {
|
||||||
stateStore.cardDescriptorChangeValue(null);
|
stateStore.cardDescriptorChangeValue(null);
|
||||||
|
@ -75,9 +75,9 @@ function formatUrl(id) {
|
||||||
return props.url.replace(regex, `/${newId}`);
|
return props.url.replace(regex, `/${newId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArrayData() {
|
function getArrayData(url = formatUrl()) {
|
||||||
return useArrayData(props.dataKey, {
|
return useArrayData(props.dataKey, {
|
||||||
url: formatUrl(),
|
url,
|
||||||
userFilter: props.filter,
|
userFilter: props.filter,
|
||||||
oneRecord: true,
|
oneRecord: true,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue