Skip to content

Command Palette ​

Vue 已实现 · 还原验收 0/1 · 上游演示 · 固定版本源码

预览 ​

  • Release notesDocumentation
  • Open workspaceNavigation
  • SettingsNavigation

用法 ​

vue
<script setup lang="ts">
import { ref } from 'vue'
import { CommandPalette } from 'beui-vue'
const selected = ref('')
const commands = [
  {id:'release',label:'Release notes',group:'Documentation',keywords:['changelog']},
  {id:'workspace',label:'Open workspace',group:'Navigation'},
  {id:'settings',label:'Settings',group:'Navigation'},
]
</script>
<template><div><CommandPalette :items="commands" @select="selected=$event.label ?? ''" /><output>{{ selected }}</output></div></template>

API ​

items 定义包含关键词与分组的命令,v-model:open 控制弹窗,shortcut 设置快捷键,@select 返回选中项。

还原验收 ​

基于 beUI 的独立 Vue 移植,依 MIT 许可证分发。