72 lines
1.7 KiB
Vue
72 lines
1.7 KiB
Vue
<script setup>
|
|
const { $empty, $insertapi } = useNuxtApp();
|
|
|
|
const isLoading = ref(false);
|
|
const body = ref({
|
|
code: null,
|
|
port: null,
|
|
technologies: null,
|
|
});
|
|
|
|
async function submit() {
|
|
isLoading.value = true;
|
|
await $insertapi("Charging_Technology", body.value);
|
|
isLoading.value = false;
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<form class="fixed-grid has-12-cols">
|
|
<div class="grid">
|
|
<div class="cell is-col-span-4">
|
|
<div class="field">
|
|
<label class="label">Mã</label>
|
|
<div class="control">
|
|
<input
|
|
type="text"
|
|
class="input"
|
|
v-model.trim="body.code"
|
|
placeholder="Mã"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cell is-col-span-4">
|
|
<div class="field">
|
|
<label class="label">Cổng</label>
|
|
<div class="control">
|
|
<input
|
|
type="text"
|
|
class="input"
|
|
v-model.trim="body.port"
|
|
placeholder="Cổng"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cell is-col-span-4">
|
|
<div class="field">
|
|
<label class="label">Công nghệ</label>
|
|
<div class="control">
|
|
<input
|
|
type="text"
|
|
class="input"
|
|
v-model.trim="body.technologies"
|
|
placeholder="Công nghệ"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="cell is-col-span-12">
|
|
<button
|
|
@click.prevent="submit"
|
|
:disabled="Object.values(body).every($empty)"
|
|
:class="['button is-primary', { 'is-loading': isLoading }]"
|
|
>
|
|
Thêm
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</template>
|