welcome to nuxt glorious

Input

A component for enter text


Example

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

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,
            }
        }
    }
}

        

props

PropTypeDefault
model valueany
colororange | blue | gray | red | primaryprimary
placeholderstring
titlestring
displayTextKeystringtext
keyOfValuestringtext
requiredbooleanfalse
errorstring|
iconstring
disablebooleanfalse
optionsArray<object>false
loadingbooleanfalse
type button | checkbox | color | date | email | file | hidden | password | radio | range | tel | text | url | number text
autocompleteon | offoff
displayprice
inputMode text | none | decimal | numeric | tel | search | email | url text
modenormal | tagnormal
tagLockOptionbooleanfalse
sizexl | lg | md | sm | xsmd