A component for enter text
Simple example for GInput
<GInput placeholder="enter text"/>
GInput get options prop until can select between more item
for use select you should set mode prop to tag
maybe your options has title and value key for show title you can set displayTextKey prop to title default value is text
<script lang="ts" setup>
const options = [
{
text: 'Cpu',
value: 1,
},
{
text: 'Ram',
value: 2,
},
{
text: 'Gpu',
value: 3,
},
]
</script>
<template>
<GInput
placeholder="select option"
:options="options"
mode="tag"
/>
</template>
some times you have tag and with enter want add tag
in this mode if set tagLockOption prop enter disable and tag not added
<GInput
placeholder="enter text and press enter"
mode="tag"
/>
config for global setting , set on nuxt.config
glorious:{
components:{
button:{
props:{
color:'green',
placeholder:'',
title:'',
displayTextKey:text,
required:false,
disable:false,
loading:false,
type:'text',
autocomplete:'off',
display:'',
inputMode:'text',
mode:'normal',
tagLockOption:false,
}
}
}
}
Prop | Type | Default |
---|---|---|
model value | any | |
color | orange | blue | gray | red | primary | primary |
placeholder | string | |
title | string | |
displayTextKey | string | text |
keyOfValue | string | text |
required | boolean | false |
error | string | | |
icon | string | |
disable | boolean | false |
options | Array<object> | false |
loading | boolean | false |
type | button | checkbox | color | date | email | file | hidden | password | radio | range | tel | text | url | number | text |
autocomplete | on | off | off |
display | price | |
inputMode | text | none | decimal | numeric | tel | search | email | url | text |
mode | normal | tag | normal |
tagLockOption | boolean | false |
size | xl | lg | md | sm | xs | md |