naive-ui/demo/documentation/components/input/zhCN/pair.md

763 B
Raw Blame History

输入成对值

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