Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 097e074

Browse files
committed
feat: add a search button on the nav
1 parent b8a8ee7 commit 097e074

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ The development server will be running at [http://localhost:3000](http://localho
4444
- [ ] Allow each guide to configure file filter
4545
- [ ] Persist user changes when toggling solutions
4646
- [ ] Verification for tutorial tasks
47-
- [ ] Search feature
47+
- [x] Search feature
4848
- [x] Search in command palette
49-
- [ ] Search button
50-
- [ ] Navigation
49+
- [x] Search button
50+
- [x] Navigation
5151
- [x] Dropdown for guide outlines
5252
- [x] Breadcrumbs
5353
- [x] Previous/Next buttons

components/CommandPalette.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ useEventListener('keydown', (e) => {
8888
v-if="commands.isShown"
8989
fixed inset-0 z-index-command-palette flex="~ items-center justify-center"
9090
>
91-
<div absolute inset-0 z--1 bg-black:75 />
91+
<div
92+
absolute inset-0 z--1 bg-black:75
93+
@click="commands.isShown = false"
94+
/>
9295
<div
9396
border="~ base rounded" h-100 w-200 of-hidden bg-base
9497
grid="~ rows-[max-content_1fr]"

components/TheNav.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const ui = useUiState()
33
const play = usePlaygroundStore()
44
const guide = useGuideStore()
55
const runtime = useRuntimeConfig()
6+
const commands = useCommandsStore()
67
78
const repo = 'https://github.com/nuxt/learn.nuxt.com'
89
const buildTime = new Date(runtime.public.buildTime)
@@ -44,6 +45,14 @@ addCommands(
4445
flex="~ gap-1 items-center"
4546
:class="guide.embeddedDocs ? 'z-embedded-docs-raised' : ''"
4647
>
48+
<button
49+
rounded p2
50+
hover="bg-active"
51+
title="Search"
52+
@click="commands.isShown = true"
53+
>
54+
<div i-ph-magnifying-glass-duotone text-2xl />
55+
</button>
4756
<button
4857
v-if="play.status === 'ready' && guide.features.download !== false"
4958
rounded p2

0 commit comments

Comments
 (0)