mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 23:25:03 -04:00
feat(c-input): Add monospace prop
This commit is contained in:
parent
49cb3ca88f
commit
9354916f03
1 changed files with 9 additions and 1 deletions
|
@ -30,6 +30,7 @@ const props = withDefaults(
|
||||||
rows?: number | string
|
rows?: number | string
|
||||||
autosize?: boolean
|
autosize?: boolean
|
||||||
autofocus?: boolean
|
autofocus?: boolean
|
||||||
|
monospace?: boolean
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
value: '',
|
value: '',
|
||||||
|
@ -56,13 +57,14 @@ const props = withDefaults(
|
||||||
rows: 3,
|
rows: 3,
|
||||||
autosize: false,
|
autosize: false,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
monospace: false,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
const emit = defineEmits(['update:value']);
|
const emit = defineEmits(['update:value']);
|
||||||
const value = useVModel(props, 'value', emit);
|
const value = useVModel(props, 'value', emit);
|
||||||
const showPassword = ref(false);
|
const showPassword = ref(false);
|
||||||
|
|
||||||
const { id, placeholder, label, validationRules, labelPosition, labelWidth, labelAlign, autosize, readonly, disabled, clearable, type, multiline, rows, rawText, autofocus } = toRefs(props);
|
const { id, placeholder, label, validationRules, labelPosition, labelWidth, labelAlign, autosize, readonly, disabled, clearable, type, multiline, rows, rawText, autofocus, monospace } = toRefs(props);
|
||||||
|
|
||||||
const validation
|
const validation
|
||||||
= props.validation
|
= props.validation
|
||||||
|
@ -157,6 +159,9 @@ defineExpose({
|
||||||
ref="textareaRef"
|
ref="textareaRef"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
class="input"
|
class="input"
|
||||||
|
:class="{
|
||||||
|
'leading-5 !font-mono': monospace,
|
||||||
|
}"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
@ -175,6 +180,9 @@ defineExpose({
|
||||||
v-model="value"
|
v-model="value"
|
||||||
:type="htmlInputType"
|
:type="htmlInputType"
|
||||||
class="input"
|
class="input"
|
||||||
|
:class="{
|
||||||
|
'leading-5 !font-mono': monospace,
|
||||||
|
}"
|
||||||
size="1"
|
size="1"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue