File tree Expand file tree Collapse file tree 5 files changed +27
-7
lines changed Expand file tree Collapse file tree 5 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 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.
2
7
3
8
## Preview
4
9
10
+ ![ Preview] ( public/vue-command-palette.gif )
11
+
5
12
## Features
6
13
7
14
- 🧩 [ Compound Component] ( https://kentcdodds.com/blog/compound-components-with-react-hooks ) Design
15
+ - 💄 Completely unstyled, but more customizable
8
16
- 🔍 Fuzzy search support to find relevant command
9
17
- ⌨️ keyboard shortcut support to bind custom keybindings to your command
10
18
@@ -42,8 +50,6 @@ Then you can import the `Command` [Compound Component](https://kentcdodds.com/bl
42
50
<script lang="ts" setup>
43
51
import { ref } from 'vue'
44
52
import { Command } from 'vue-command-palette'
45
-
46
- const visible = ref(false)
47
53
</script>
48
54
49
55
<style>
@@ -116,6 +122,11 @@ const visible = ref(false)
116
122
117
123
### Command.Loading
118
124
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
+
119
130
## License
120
131
121
132
MIT [ @xiaoluoboding ] ( https://github.com/xiaoluoboding )
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ export {}
7
7
8
8
declare module '@vue/runtime-core' {
9
9
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' ]
10
13
CmdkPlaceholder : typeof import ( './src/components/common/CmdkPlaceholder.vue' ) [ 'default' ]
11
14
FigmaIcon : typeof import ( './src/components/icons/FigmaIcon.vue' ) [ 'default' ]
12
15
Home : typeof import ( './src/components/command/raycast/Home.vue' ) [ 'default' ]
@@ -21,6 +24,7 @@ declare module '@vue/runtime-core' {
21
24
LinearRemoveLabelIcon : typeof import ( './src/components/icons/LinearRemoveLabelIcon.vue' ) [ 'default' ]
22
25
LinearSetDueDateIcon : typeof import ( './src/components/icons/LinearSetDueDateIcon.vue' ) [ 'default' ]
23
26
Logo : typeof import ( './src/components/icons/Logo.vue' ) [ 'default' ]
27
+ 'Mdi:heart' : typeof import ( '~icons/mdi/heart' ) [ 'default' ]
24
28
MoonIcon : typeof import ( './src/components/icons/MoonIcon.vue' ) [ 'default' ]
25
29
Projects : typeof import ( './src/components/command/vercel/Projects.vue' ) [ 'default' ]
26
30
Raycast : typeof import ( './src/components/command/raycast/Raycast.vue' ) [ 'default' ]
Original file line number Diff line number Diff line change @@ -39,10 +39,7 @@ watchEffect(() => {
39
39
observer = new ResizeObserver ((entries ) => {
40
40
nextTick (() => {
41
41
const height = sizer ?.offsetHeight
42
- const wrapperH = wrapper ?.offsetHeight
43
42
44
- console .log (height )
45
- console .log (wrapperH )
46
43
wrapper ?.style .setProperty (
47
44
' --command-list-height' ,
48
45
` ${height ?.toFixed (1 )}px `
Original file line number Diff line number Diff line change @@ -204,7 +204,15 @@ const togglePage = () => {
204
204
whenever (
205
205
() => current .has (' backspace' ),
206
206
() => {
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
208
216
togglePage ()
209
217
}
210
218
)
You can’t perform that action at this time.
0 commit comments