Skip to content

Commit 85bdfcc

Browse files
committed
docs: update README.md
1 parent 4b89cd5 commit 85bdfcc

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
# Command Palette for Vue 3
1+
# Command Palette for Vue
2+
3+
![vue-command-palette minzip package size](https://img.shields.io/bundlephobia/minzip/vue-command-palette)
4+
![vue-command-palette package version](https://img.shields.io/npm/v/vue-command-palette.svg?colorB=green)
5+
6+
> A fast, composable, unstyled `command` + `k` command palette for Vue.
27
38
## Preview
49

10+
![Preview](public/vue-command-palette.gif)
11+
512
## Features
613

714
- 🧩 [Compound Component](https://kentcdodds.com/blog/compound-components-with-react-hooks) Design
15+
- 💄 Completely unstyled, but more customizable
816
- 🔍 Fuzzy search support to find relevant command
917
- ⌨️ keyboard shortcut support to bind custom keybindings to your command
1018

@@ -42,8 +50,6 @@ Then you can import the `Command` [Compound Component](https://kentcdodds.com/bl
4250
<script lang="ts" setup>
4351
import { ref } from 'vue'
4452
import { Command } from 'vue-command-palette'
45-
46-
const visible = ref(false)
4753
</script>
4854
4955
<style>
@@ -116,6 +122,11 @@ const visible = ref(false)
116122

117123
### Command.Loading
118124

125+
## Inspiration
126+
127+
- [cmdk](https://github.com/pacocoursey/cmdk) - Fast, unstyled command menu React component.
128+
- [kbar](https://github.com/timc1/kbar) - fast, portable, and extensible cmd+k interface for your site.
129+
119130
## License
120131

121132
MIT [@xiaoluoboding](https://github.com/xiaoluoboding)

components.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export {}
77

88
declare module '@vue/runtime-core' {
99
export interface GlobalComponents {
10+
'Carbon:cafe': typeof import('~icons/carbon/cafe')['default']
11+
'Carbon:logoGithub': typeof import('~icons/carbon/logo-github')['default']
12+
'Carbon:logoTwitter': typeof import('~icons/carbon/logo-twitter')['default']
1013
CmdkPlaceholder: typeof import('./src/components/common/CmdkPlaceholder.vue')['default']
1114
FigmaIcon: typeof import('./src/components/icons/FigmaIcon.vue')['default']
1215
Home: typeof import('./src/components/command/raycast/Home.vue')['default']
@@ -21,6 +24,7 @@ declare module '@vue/runtime-core' {
2124
LinearRemoveLabelIcon: typeof import('./src/components/icons/LinearRemoveLabelIcon.vue')['default']
2225
LinearSetDueDateIcon: typeof import('./src/components/icons/LinearSetDueDateIcon.vue')['default']
2326
Logo: typeof import('./src/components/icons/Logo.vue')['default']
27+
'Mdi:heart': typeof import('~icons/mdi/heart')['default']
2428
MoonIcon: typeof import('./src/components/icons/MoonIcon.vue')['default']
2529
Projects: typeof import('./src/components/command/vercel/Projects.vue')['default']
2630
Raycast: typeof import('./src/components/command/raycast/Raycast.vue')['default']

packages/CommandList.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ watchEffect(() => {
3939
observer = new ResizeObserver((entries) => {
4040
nextTick(() => {
4141
const height = sizer?.offsetHeight
42-
const wrapperH = wrapper?.offsetHeight
4342
44-
console.log(height)
45-
console.log(wrapperH)
4643
wrapper?.style.setProperty(
4744
'--command-list-height',
4845
`${height?.toFixed(1)}px`

public/vue-command-palette.gif

6.66 MB
Loading

src/components/command/Self.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@ const togglePage = () => {
204204
whenever(
205205
() => current.has('backspace'),
206206
() => {
207-
if (isHomePage.value || inputValue.value.length) return
207+
const commandInputEl = document.querySelector(
208+
'input[command-input]'
209+
) as HTMLInputElement
210+
if (
211+
isHomePage.value ||
212+
inputValue.value.length ||
213+
commandInputEl.value.length
214+
)
215+
return
208216
togglePage()
209217
}
210218
)

0 commit comments

Comments
 (0)