This commit is contained in:
Viet An
2026-07-03 10:22:08 +07:00
parent 4404c4654b
commit b06907097c
11 changed files with 107 additions and 111 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div :id="id">
<template v-if="keys.length > 0">
<div
class="field is-horizontal"
@@ -35,7 +35,7 @@
>
<span class="icon">
<Icon
name="material-symbols:app-registration-rounded"
name="material-symbols:data-object-rounded"
:size="20"
/>
</span>
@@ -58,37 +58,46 @@
</div>
</div>
</template>
<button
class="button is-success is-light"
@click="addAttr()"
<Teleport
defer
:to="`.modal-card:has(#${id}) .modal-card-foot`"
>
<span class="icon">
<Icon
name="material-symbols:add-rounded"
:size="20"
/>
</span>
<span>Thêm thuộc tính</span>
</button>
<div class="mt-2">
<button
class="button is-primary"
@click="update()"
>
Cập nhật
</button>
</div>
<div class="buttons is-justify-content-space-between w-full">
<button
class="button is-success is-light"
@click="addAttr()"
>
<span class="icon">
<Icon
name="material-symbols:add-rounded"
:size="20"
/>
</span>
<span>Thêm thuộc tính</span>
</button>
<button
class="button is-primary"
@click="update()"
>
Cập nhật
</button>
</div>
</Teleport>
<Modal
v-if="comp"
v-bind="{ component: comp, width: '40%', height: '400px', vbind }"
@close="comp = undefined"
@update="doUpdate"
v-bind="{ component: comp, width: '40%', height: '300px', vbind: vbind }"
v-if="comp"
></Modal>
/>
</div>
</template>
<script>
export default {
props: ["field", "close"],
setup() {
const id = useId();
return { id };
},
data() {
return {
keys: [],