naive-ui/demo/documentation/components/dropdown/enUS/cascade.md
2019-12-03 21:48:34 +08:00

1.1 KiB

Cascade

<n-dropdown
  placement="bottom-start"
  trigger="click"
  @select="handleSelect"
>
  <template v-slot:activator>
    <n-button>People and Some Food to Eat</n-button>
  </template>
  <n-dropdown-item name="jay gatsby">
    Jay Gatsby
  </n-dropdown-item>
  <n-dropdown-item name="daisy buchanan">
    Daisy Buchanan
  </n-dropdown-item>
  <n-dropdown-divider />
  <n-dropdown-item name="nick carraway">
    Nick Carraway
  </n-dropdown-item>
  <n-dropdown-submenu>
    <template v-slot:activator>
      Others
    </template>
    <n-dropdown-item name="jordan baker">
      Jordan Baker
    </n-dropdown-item>
    <n-dropdown-divider />
    <n-dropdown-item name="tom buchanan">
      Tom Buchanan
    </n-dropdown-item>
    <n-dropdown-submenu>
      <template v-slot:activator>
        Others
      </template>
      <n-dropdown-item name="chicken">
        Chicken
      </n-dropdown-item>
      <n-dropdown-item name="beef">
        Beef
      </n-dropdown-item>
    </n-dropdown-submenu>
  </n-dropdown-submenu>
</n-dropdown>
export default {
  methods: {
    handleSelect (name) {
      this.$NMessage.info(name)
    }
  }
}