Input

A basic widget for getting the user input is a text field.

Keyboard and mouse can be used for providing or changing data.

When To Use

  • A user input in a form field is needed.
  • A search input is required.

Examples

Basic usage example.

<template>
  <a-input placeholder="Basic usage" />
</template>

Add prefix or suffix icons inside input.



RMB
<template>
  <div class="components-input-demo-presuffix">
    <a-input ref="userNameInput" v-model="userName" placeholder="Basic usage">
      <a-icon slot="prefix" type="user" />
      <a-tooltip slot="suffix" title="Extra information">
        <a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
      </a-tooltip>
    </a-input>
    <br />
    <br />
    <a-input prefix="¥" suffix="RMB" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      userName: '',
    };
  },
  methods: {
    emitEmpty() {
      this.$refs.userNameInput.focus();
      this.userName = '';
    },
  },
};
</script>

Looking for more Ant Design Vue Input? Please check the official docs.