mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 07:56:01 +00:00
Refactor DbKeyDetailTab and related components to handle item changes
This commit is contained in:
@@ -38,6 +38,12 @@
|
||||
|
||||
function addRecord() {
|
||||
records = [...records, { value: '' }];
|
||||
if (onChangeItem) {
|
||||
onChangeItem({
|
||||
...item,
|
||||
records: records,
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -56,6 +62,12 @@
|
||||
<div class="delete-wrapper col-1">
|
||||
<button class="delete-button" on:click={() => {
|
||||
records = records.filter((_, idx) => idx !== index);
|
||||
if (onChangeItem) {
|
||||
onChangeItem({
|
||||
...item,
|
||||
records: records,
|
||||
});
|
||||
}
|
||||
}}>
|
||||
<FontIcon icon="icon delete" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user