naive-ui/demo/documentation/components/popselect/zhCN/multiple.demo.md
07akioni 487001d697 build: add changelog to site, refactor loader based on suffix
.demo.md for component demo
.demo-entry.md for demo entry
.md for common docs
2020-08-19 23:30:04 +08:00

774 B

多选

在弹出选择选中多个值。

<n-popselect
  v-model="value"
  multiple
  :options="options"
  @change="handleChange"
>
  <n-tag>{{ (Array.isArray(value) && value.length) ? value : '没了' }}</n-tag>
</n-popselect>
export default {
  data () {
    return {
      value: null,
      options: [{
        label: 'Go Let It Out',
        value: 'Go Let It Out'
      }, {
        label: 'Who Feels Love?',
        value: 'Who Feels Love?'
      }, {
        label: 'Sunday Morning Call',
        value: 'Sunday Morning Call',
        disabled: true
      }, {
        label: 'Roll It Over',
        value: 'Roll It Over'
      }]
    }
  },
  methods: {
    handleChange (value) {
      this.$NMessage.info(JSON.stringify(value))
    }
  }
}