feat: create new order
This commit is contained in:
46
spa/src/components/Form/TgInput.vue
Normal file
46
spa/src/components/Form/TgInput.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<fieldset class="fieldset mb-0">
|
||||
<input
|
||||
:type="type"
|
||||
:inputmode="inputMode"
|
||||
class="input w-full"
|
||||
:class="error ? 'input-error' : ''"
|
||||
:placeholder="placeholder"
|
||||
v-model="model"
|
||||
@input="$emit('clearError')"
|
||||
/>
|
||||
<p v-if="error" class="label">{{ error }}</p>
|
||||
</fieldset>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {computed} from "vue";
|
||||
|
||||
const model = defineModel();
|
||||
const props = defineProps({
|
||||
error: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
|
||||
type: {
|
||||
type: String,
|
||||
default: 'text',
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['clearError']);
|
||||
|
||||
const inputMode = computed(() => {
|
||||
switch (props.type) {
|
||||
case 'email': return 'email';
|
||||
case 'tel': return 'tel';
|
||||
case 'number': return 'numeric';
|
||||
default: return 'text';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
30
spa/src/components/Form/TgTextarea.vue
Normal file
30
spa/src/components/Form/TgTextarea.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<fieldset class="fieldset mb-0">
|
||||
<textarea
|
||||
class="input w-full h-30"
|
||||
:class="error ? 'input-error' : ''"
|
||||
:placeholder="placeholder"
|
||||
v-model="model"
|
||||
@input="$emit('clearError')"
|
||||
rows="5"
|
||||
/>
|
||||
<p v-if="error" class="label">{{ error }}</p>
|
||||
</fieldset>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
const model = defineModel();
|
||||
const props = defineProps({
|
||||
error: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['clearError']);
|
||||
</script>
|
||||
Reference in New Issue
Block a user