naive-ui/demo/documentation/components/input/zhCN/icon.demo.md
2020-11-07 00:07:02 +08:00

747 B

前缀 & 后缀

在前缀后缀添加内容。

<n-space vertical>
  <n-input v-model:value="value" placeholder="搜索">
    <template v-slot:prefix>
      <n-icon>
        <search-outline/>
      </n-icon>
    </template>
  </n-input>
  <n-input v-model:value="value" round placeholder="100,000,000">
    <template v-slot:suffix></template>
  </n-input>
  <n-input v-model:value="value" round placeholder="搜索">
    <template v-slot:suffix>
      <n-icon>
        <search-outline/>
      </n-icon>
    </template>
  </n-input>
</n-space>
import {
  SearchOutline
} from '@vicons/ionicons-v5'

export default {
  components: {
    SearchOutline
  },
  data () {
    return {
      value: null
    }
  }
}