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

Commit b3af938

Browse files
committed
docs: content
1 parent 9ff03ab commit b3af938

File tree

23 files changed

+225
-54
lines changed

23 files changed

+225
-54
lines changed

components/PanelDocs.vue

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const sourceUrl = computed(() => page.value?._file
6262
</script>
6363

6464
<template>
65-
<div grid="~ rows-[min-content_1fr_min-content]" relative h-full>
65+
<div grid="~ rows-[min-content_1fr]" relative h-full>
6666
<div flex="~ gap-2 items-center" border="b base dashed" bg-faded px4 py2>
6767
<div i-ph-book-duotone />
6868
<template v-for="bc, idx of breadcrumbs" :key="bc.path">
@@ -107,6 +107,18 @@ const sourceUrl = computed(() => page.value?._file
107107
/>
108108
</div>
109109
</div>
110+
<div border="t base dashed" mt-8 p3>
111+
<NuxtLink
112+
v-if="sourceUrl"
113+
:to="sourceUrl" target="_blank"
114+
flex="~ items-center gap-2"
115+
text-inherit op75
116+
hover="text-primary op100"
117+
>
118+
<div i-ph-note-pencil-duotone />
119+
Edit this page
120+
</NuxtLink>
121+
</div>
110122
</article>
111123
<!-- Navigration Dropdown -->
112124
<Transition name="nav-dropdown">
@@ -121,16 +133,6 @@ const sourceUrl = computed(() => page.value?._file
121133
</div>
122134
</Transition>
123135
</div>
124-
<div border="t base dashed" px6 py2>
125-
<NuxtLink
126-
v-if="sourceUrl"
127-
:to="sourceUrl" target="_blank"
128-
flex="~ items-center gap-2" op50 hover="text-primary op100"
129-
>
130-
<div i-ph-note-pencil-duotone />
131-
Edit this page
132-
</NuxtLink>
133-
</div>
134136
</div>
135137
</template>
136138

components/PanelEditor.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,10 @@ const panelInitEditor = computed(() => isMounted.value || {
9292
>
9393
<FileIcon :path="play.fileSelected?.filepath || ''" />
9494
<span flex-auto text-sm>{{ play.fileSelected?.filepath || 'Editor' }}</span>
95-
<button
96-
v-if="guide.currentGuide?.solutions"
95+
<ButtonShowSolution
9796
my--1 mr--3 flex-none rounded px2 py1 text-sm op50
9897
hover="bg-active op100"
99-
flex="~ gap-2 items-center"
100-
@click="guide.toggleSolutions()"
101-
>
102-
<div v-if="!guide.showingSolution " i-ph-lightbulb-filament-duotone />
103-
<div v-else i-ph-arrow-counter-clockwise-duotone />
104-
{{ guide.showingSolution ? 'Reset challenge' : 'Show solution' }}
105-
</button>
98+
/>
10699
</div>
107100
<LazyPanelEditorMonaco
108101
v-if="play.fileSelected"

components/PanelEditorMonaco.client.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const language = computed(() => {
4444
}
4545
})
4646
const theme = computed(() => colorMode.value === 'dark'
47-
? 'vitesse-black'
47+
? 'vitesse-dark'
4848
: 'vitesse-light',
4949
)
5050

components/TheNav.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ addCommands(
3939
<NuxtLink to="/" title="Nuxt Tutorial">
4040
<NuxtTutorialLogo h-2em />
4141
</NuxtLink>
42+
<NuxtLink
43+
href="https://github.com/nuxt/learn.nuxt.com"
44+
target="_blank"
45+
>
46+
<div block translate-y--2 rounded bg-orange:10 px2 py1 text-xs text-orange>
47+
Working in Progress
48+
</div>
49+
</NuxtLink>
4250

4351
<div flex-auto />
4452
<div
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
const guide = useGuideStore()
3+
</script>
4+
5+
<template>
6+
<button
7+
v-if="guide.currentGuide?.solutions"
8+
flex="~ gap-2 items-center"
9+
@click="guide.toggleSolutions()"
10+
>
11+
<div v-if="!guide.showingSolution " i-ph-lightbulb-filament-duotone />
12+
<div v-else i-ph-arrow-counter-clockwise-duotone />
13+
{{ guide.showingSolution ? 'Reset challenge' : 'Show solution' }}
14+
</button>
15+
</template>

components/content/Note.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div border="~ base rounded-lg" bg-active p3 px4 text-sm class="[&>p]:my-0 [&>p]:leading-1.75em" text-faded>
3+
<slot />
4+
</div>
5+
</template>

content/0.index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ ogImage:
99

1010
# Welcome to Nuxt Tutorial!
1111

12-
[🚧 Working in Progress](https://github.com/nuxt/learn.nuxt.com#todolist){.text-orange}
13-
1412
This is an interactive tutorial that is composed with guides and challenges to help you learn [Nuxt](https://nuxt.com/) and its concepts step by step.
1513

14+
The goal of this tutorial is to quickly give you an experience of what it feels like to work with Nuxt and Vue, **right in the browser**. It does not aim to be comprehensive, and you don't need to understand everything before moving on. All playgrounds are editable with a full-featured editor and dev environment, so you can play with the code and see the result right away and learn by doing.
15+
1616
## What's Nuxt?
1717

1818
Nuxt is a free and [open-source framework](https://github.com/nuxt/nuxt) with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with [Vue.js](https://vuejs.org). Nuxt has no vendor lock-in, allowing you to deploy your application [**everywhere, even on the edge**](https://nuxt.com/blog/nuxt-on-the-edge).

content/1.vue/1.index.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,16 @@ ogImage: true
66

77
Nuxt integrates [Vue 3](https://vuejs.org/), a progressive framework for building user interfaces. In this section, we will cover the basics of Vue.
88

9-
A typical [Vue Single-File Component](https://vuejs.org/guide/scaling-up/sfc.html) (a.k.a. `*.vue` files, abbreviated as SFC) looks like this:
9+
What you see in the editor is a [Vue Single-File Component](https://vuejs.org/guide/scaling-up/sfc.html)(SFC).
1010

11-
```vue
12-
<script setup>
13-
import { ref } from 'vue'
14-
const count = ref(0)
15-
</script>
16-
17-
<template>
18-
<button @click="count++">
19-
Count is: {{ count }}
20-
</button>
21-
</template>
22-
23-
<style scoped>
24-
button {
25-
font-weight: bold;
26-
}
27-
</style>
28-
```
29-
30-
Vue SFC is a natural extension of the classic trio of HTML, CSS and JavaScript. It compose with a `<script setup>` block to define the JavaScript logic, a `<template>` block to define the HTML template and optional `<style>` blocks to define the CSS style. You can play with it using it the playground on the right, or read more about it in the [official Vue documentation](https://v3.vuejs.org/guide/single-file-component.html).
11+
An SFC is a reusable self-contained block of code that encapsulates HTML, CSS and JavaScript that belong together, written inside a .vue file. It's composed with a [`<script setup>`](https://vuejs.org/api/sfc-script-setup.html)) block to define the JavaScript logic, a `<template>` block to define the HTML template and optional `<style>` blocks to define the CSS style. You can play with it using it the playground on the right, or read more about it in the [official Vue documentation](https://v3.vuejs.org/guide/single-file-component.html).
3112

3213
In Nuxt, we supports Vue SFC out-of-box and highly recommend you to use it to build your application. One thing that is different from Vue's default Vue SFC is that in Nuxt we [auto-imports the Vue utilities](https://nuxt.com/docs/guide/concepts/auto-imports) for you, so you can use `ref`, `computed` and other Vue APIs directly without importing them.
3314

15+
::note
16+
**Tips**: You might heard that there are a few different ways to define a Vue component. In general, we recommend using [`<script setup>`](https://vuejs.org/api/sfc-script-setup.html) with [Composition API](https://vuejs.org/guide/introduction.html#composition-api) to get the best developer experience. If you are new to Vue, don't worry too much about understanding all different choices, you can follow what we recommend as we believe it's also the most intuitive way to get started with Vue.
17+
::
18+
3419
Going forward, we will cover the following topics:
3520

3621
- [Reactivity](/vue/reactivity)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup>
2+
const count = ref(1)
3+
const doubled = computed(() => count.value * 2)
4+
5+
function increment() {
6+
count.value++
7+
}
8+
</script>
9+
10+
<template>
11+
<div>
12+
<p>count is {{ count }}</p>
13+
<p>doubled is {{ doubled }}</p>
14+
<button @click="increment">
15+
+1
16+
</button>
17+
</div>
18+
</template>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script setup>
2+
const count = ref(1)
3+
const multiplier = ref(2)
4+
const result = computed(() => count.value * multiplier.value)
5+
6+
function increment() {
7+
count.value++
8+
}
9+
function multiply() {
10+
multiplier.value++
11+
}
12+
</script>
13+
14+
<template>
15+
<div>
16+
<p>count is {{ count }}</p>
17+
<p>result is {{ result }}</p>
18+
<button @click="increment">
19+
+1
20+
</button>
21+
<button @click="multiply">
22+
x{{ multiplier }}
23+
</button>
24+
</div>
25+
</template>

0 commit comments

Comments
 (0)