# Input组件

# 1.基础用法

默认按钮
Hello World

可以支持双向绑定

<template>
    <g-input  v-model:value="text">默认按钮</g-input>
    <div>{{text}}</div>
</template>
<script>
export default {
  name:"InputDemo",
  data(){
    return{
      text:'Hello World'
    }
  }
}
</script>
<style>

</style>
Expand Copy

# 2.支持disabled

默认按钮

设置disabled,禁用输入

<template>
    <g-input value="禁用" disabled>默认按钮</g-input>
</template>
Expand Copy

# 3.支持readonly

默认按钮

设置readonly,表示只读无法修改

<template>
    <g-input value="只读" readonly>默认按钮</g-input>
</template>
Expand Copy

# 4.支持error

默认按钮

添加 error 属性,会在该 input 右侧显示一个提示图标与文字,用于提示

<template>
    <g-input  value="只读" error="错误">默认按钮</g-input>
</template>
Expand Copy

# Attributes

参数 说明 类型 可选值 默认值
disabled 禁用 Boolean true/false false
readonly 按钮大小 Boolean true/false false
error 提示错误信息 String