diff --git a/src/views/Editor.vue b/src/views/Editor.vue index 800595b..f454d84 100644 --- a/src/views/Editor.vue +++ b/src/views/Editor.vue @@ -3,7 +3,10 @@ import { ref } from 'vue' import DataTable from 'primevue/datatable' import Column from 'primevue/column' +import ColumnGroup from 'primevue/columngroup' import Image from 'primevue/image' +import InputText from 'primevue/inputtext' +import Row from 'primevue/row' const sampleData = ref([ { @@ -29,6 +32,7 @@ const sampleData = ref([ }, }, ]) +const editingRows = ref([]) const sampleFields = ref([ { field: 'name', header: 'Name', type: 'text' }, @@ -36,29 +40,69 @@ const sampleFields = ref([ { field: 'quantity', header: 'Quantity', type: 'text' }, { field: 'image', header: 'Image', type: 'image' }, ]) + +const onRowEditSave = (event: { newData: any, index: number }) => { + let { newData, index } = event + sampleData.value[index] = newData + console.log(sampleData.value) +}