naive-ui/demo/documentation/components/input/zhCN/pair.demo.md
2020-10-22 12:12:11 +08:00

750 B
Raw Blame History

输入成对值

<n-input
  pair
  separator="-"
  v-model:value="value"
  :placeholder="placeholder"
  clearable
  @blur="handleInputBlur"
  @focus="handleInputFocus"
  @change="handleInputChange"
  @update:value="handleInputInput"
/>
export default {
  inject: ['message'],
  data () {
    return {
      placeholder: ['从', '到'],
      value: ['0', '100']
    }
  },
  methods: {
    handleInputBlur () {
      this.message.info('输入成对值Blur')
    },
    handleInputFocus () {
      this.message.info('输入成对值Focus')
    },
    handleInputInput () {
      this.message.info('输入成对值Input')
    },
    handleInputChange () {
      this.message.info('输入成对值Change')
    }
  }
}