Merge pull request 'Warmfix: show descriptors when click on it' (!1394) from warmfix_vnTable_card_descriptor into test
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1394
Reviewed-by: Pablo Natek <pablone@verdnatura.es>
This commit is contained in:
Javier Segarra 2025-02-14 11:39:58 +00:00
commit bc42d892ed
1 changed files with 6 additions and 7 deletions

View File

@ -304,6 +304,10 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
}
}
}
function cardClick(_, row) {
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
}
</script>
<template>
<QDrawer
@ -494,18 +498,13 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
</template>
<template #item="{ row, colsMap }">
<component
:is="$props.redirect ? 'router-link' : 'span'"
:to="`/${$props.redirect}/` + row.id"
v-bind:is="'div'"
@click="(event) => cardClick(event, row)"
>
<QCard
bordered
flat
class="row no-wrap justify-between cursor-pointer q-pa-sm"
@click="
(_, row) => {
$props.rowClick && $props.rowClick(row);
}
"
style="height: 100%"
>
<QCardSection