naive-ui/demo/documentation/components/autoComplete/enUS/group.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

534 B

Group

<n-auto-complete :options="options" v-model="value" placeholder="Email" />
export default {
  computed: {
    options () {
      return [
        ['Google', '@gmail.com'],
        ['Netease', '@163.com'],
        ['Tencent', '@qq.com']
      ].map(emailInfo => {
        return {
          type: 'group',
          name: emailInfo[0],
          children: [
            this.value.split('@')[0] + emailInfo[1]
          ]
        }
      })
    }
  },
  data () {
    return {
      value: ''
    }
  }
}