ant-design-vue/antdv-demo/docs/mentions/demo/basic.md

692 B

#### 基础列表 基本使用。 #### Basic usage Basic usage.
<template>
  <a-mentions v-model="value" @change="onChange" @select="onSelect">
    <a-mentions-option value="afc163">
      afc163
    </a-mentions-option>
    <a-mentions-option value="zombieJ">
      zombieJ
    </a-mentions-option>
    <a-mentions-option value="yesmeck">
      yesmeck
    </a-mentions-option>
  </a-mentions>
</template>
<script>
export default {
  data() {
    return {
      value: '@afc163',
    };
  },
  methods: {
    onSelect(option) {
      console.log('select', option);
    },
    onChange(value) {
      console.log('Change:', value);
    },
  },
};
</script>