52 lines
901 B
Vue
52 lines
901 B
Vue
<script setup lang="ts">
|
|
withDefaults(
|
|
defineProps<{
|
|
type?: string;
|
|
placeholder?: string;
|
|
disabled?: boolean;
|
|
required?: boolean;
|
|
maxlength?: number;
|
|
minlength?: number;
|
|
}>(),
|
|
{ type: 'text' },
|
|
);
|
|
|
|
const model = defineModel<string>({ default: '' });
|
|
</script>
|
|
|
|
<template>
|
|
<input
|
|
v-model="model"
|
|
class="ui-input"
|
|
:type="type"
|
|
:placeholder="placeholder"
|
|
:disabled="disabled"
|
|
:required="required"
|
|
:maxlength="maxlength"
|
|
:minlength="minlength"
|
|
/>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.ui-input {
|
|
width: 100%;
|
|
min-width: 0;
|
|
min-height: var(--control-h);
|
|
padding: 0 0.85rem;
|
|
border: 1px solid var(--line);
|
|
border-radius: var(--radius);
|
|
background: #fff;
|
|
color: var(--ink);
|
|
font: inherit;
|
|
}
|
|
|
|
.ui-input:focus {
|
|
outline: 2px solid var(--accent-soft);
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
.ui-input:disabled {
|
|
opacity: 0.6;
|
|
}
|
|
</style>
|