diff --git a/src/components/VnTable/VnColumn.vue b/src/components/VnTable/VnColumn.vue index 6cd62d83e..70035d6e6 100644 --- a/src/components/VnTable/VnColumn.vue +++ b/src/components/VnTable/VnColumn.vue @@ -8,6 +8,8 @@ import VnSelect from 'components/common/VnSelect.vue'; import VnInput from 'components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnComponent from 'components/common/VnComponent.vue'; +import VnDescriptor from 'components/VnTable/VnDescriptor.vue'; +import { QBtn } from 'quasar'; const model = defineModel(undefined, { required: true }); const $props = defineProps({ @@ -102,6 +104,17 @@ const defaultComponents = { icon: { component: markRaw(QIcon), }, + descriptor: { + component: markRaw(VnDescriptor), + attrs: { + class: 'link', + flat: true, + dense: true, + }, + forceAttrs: { + row: $props.row, + }, + }, }; const value = computed(() => { diff --git a/src/components/VnTable/VnDescriptor.vue b/src/components/VnTable/VnDescriptor.vue new file mode 100644 index 000000000..b280c7f6c --- /dev/null +++ b/src/components/VnTable/VnDescriptor.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 493f1480e..7acec4fe7 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -59,6 +59,10 @@ const $props = defineProps({ type: Boolean, default: false, }, + hasSubtoolbar: { + type: Boolean, + default: true, + }, }); const { t } = useI18n(); const stateStore = useStateStore(); @@ -175,11 +179,14 @@ function columnName(col) { } function getColAlign(col) { - return 'text-' + (col.align ?? 'left') + return 'text-' + (col.align ?? 'left'); } + +const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); defineExpose({ reload, redirect: redirectFn, + selected, });