Skip to content

Commit 5d97409

Browse files
committed
Switch to cleanUrls
1 parent cdddb03 commit 5d97409

File tree

10 files changed

+45
-44
lines changed

10 files changed

+45
-44
lines changed

docs/.vitepress/config.mjs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { defineConfigWithTheme } from 'vitepress'
22

33
export default defineConfigWithTheme({
44
outDir: '../dist',
5+
cleanUrls: true,
56
base: '/vue-examples',
67
title: 'Vue Examples',
78
lang: 'en-US',
@@ -29,47 +30,47 @@ export default defineConfigWithTheme({
2930
items: [
3031
{
3132
text: 'Checkbox',
32-
link: '/components/checkbox.html',
33+
link: '/components/checkbox',
3334
}, {
3435
text: 'Radio',
35-
link: '/components/radio.html',
36+
link: '/components/radio',
3637
}, {
3738
text: 'Toggle Switch',
38-
link: '/components/toggle-switch.html',
39+
link: '/components/toggle-switch',
3940
}, {
4041
text: 'Radio Group',
41-
link: '/components/radio-group.html'
42+
link: '/components/radio-group'
4243
}, {
4344
text: 'Accordion',
44-
link: '/components/accordion.html',
45+
link: '/components/accordion',
4546
}, {
4647
text: 'Tabs',
47-
link: '/components/tabs.html',
48+
link: '/components/tabs',
4849
}
4950
]
5051
}, {
5152
text: 'Patterns',
5253
items: [
5354
{
5455
text: 'Computed with v-model',
55-
link: '/patterns/computed-v-model.html'
56+
link: '/patterns/computed-v-model'
5657
}, {
5758
text: 'Global Properties',
58-
link: '/patterns/global-properties.html'
59+
link: '/patterns/global-properties'
5960
}, {
6061
text: 'Coupled Components with provide/inject',
61-
link: '/patterns/coupled-components-with-provide-inject.html'
62+
link: '/patterns/coupled-components-with-provide-inject'
6263
}
6364
]
6465
}, {
6566
text: 'Guides',
6667
items: [
6768
{
6869
text: 'Working with Image Assets',
69-
link: '/guides/working-with-image-assets.html'
70+
link: '/guides/working-with-image-assets'
7071
}, {
7172
text: 'Understanding the Vue Source Code',
72-
link: '/advanced/understanding-the-vue-source-code.html'
73+
link: '/advanced/understanding-the-vue-source-code'
7374
}
7475
]
7576
}, {
@@ -78,16 +79,16 @@ export default defineConfigWithTheme({
7879
items: [
7980
{
8081
text: 'Tic-tac-toe',
81-
link: '/exercises/tic-tac-toe.html'
82+
link: '/exercises/tic-tac-toe'
8283
}, {
8384
text: 'Quiz',
84-
link: '/exercises/quiz.html'
85+
link: '/exercises/quiz'
8586
}, {
8687
text: 'Minesweeper',
87-
link: '/exercises/minesweeper.html'
88+
link: '/exercises/minesweeper'
8889
}, {
8990
text: 'Numbers Game',
90-
link: '/exercises/numbers-game.html'
91+
link: '/exercises/numbers-game'
9192
}
9293
]
9394
}

docs/components/accordion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The corresponding `accordion-panel.vue` is:
3131

3232
## Vue Patterns
3333

34-
See [Coupled Components with `provide`/`inject`](../patterns/coupled-components-with-provide-inject.html).
34+
See [Coupled Components with `provide`/`inject`](../patterns/coupled-components-with-provide-inject).
3535

3636
<!--
3737
## Missing Functionality

docs/components/checkbox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The wrapper `<div>` will receive any extra attributes specified on the parent, i
9292

9393
## Related Components
9494

95-
An individual checkbox represents a choice between two values. This is effectively the same as a [Toggle Switch](./toggle-switch.html) (left/right) or a Toggle Button (pressed/unpressed).
95+
An individual checkbox represents a choice between two values. This is effectively the same as a [Toggle Switch](./toggle-switch) (left/right) or a Toggle Button (pressed/unpressed).
9696

9797
Multiple checkboxes can be used to model multiple selections, often represented using an `Array` or `Set` containing the selected values. This can also be represented using a list, like a `<select multiple>`. Some dropdowns also support multiple selections, often in combination with a tag/chip/pill component to show the selected values when the list is collapsed.
9898

docs/components/radio-group.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ The `radio.vue` here is specially written to use `inject` instead of a `modelVal
5454

5555
<<< @/components/radio-group/radio.vue
5656

57-
Support for direct use of `v-model` with the `radio` component has been omitted from this example. That technique is shown in the [Radio example](./radio.html). The two can be combined by using a default value with `inject` and then checking whether that value is set.
57+
Support for direct use of `v-model` with the `radio` component has been omitted from this example. That technique is shown in the [Radio example](./radio). The two can be combined by using a default value with `inject` and then checking whether that value is set.
5858

5959
## Vue Patterns
6060

61-
See [Coupled Components with `provide`/`inject`](../patterns/coupled-components-with-provide-inject.html)
61+
See [Coupled Components with `provide`/`inject`](../patterns/coupled-components-with-provide-inject)
6262

6363
Apart from the naming choices, there's nothing in this `radio-group.vue` implementation that assumes the children are radio buttons. It could be made to work with checkboxes, toggle switches or any similar components that involve picking from a list of options.
6464

docs/components/tabs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The code for `tabs.vue` looks long, but a lot of it is CSS:
3131

3232
## Vue Patterns
3333

34-
See [Coupled Components with `provide`/`inject`](../patterns/coupled-components-with-provide-inject.html)
34+
See [Coupled Components with `provide`/`inject`](../patterns/coupled-components-with-provide-inject)
3535

3636
<!--
3737
## Missing Functionality

docs/components/toggle-switch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The implementation includes a lot of CSS, but it is otherwise very similar to a
4848

4949
## Related Components
5050

51-
An individual toggle switch represents a choice between two values. This is effectively the same as a [Checkbox](./checkbox.html) (checked/unchecked) or a Toggle Button (pressed/unpressed).
51+
An individual toggle switch represents a choice between two values. This is effectively the same as a [Checkbox](./checkbox) (checked/unchecked) or a Toggle Button (pressed/unpressed).
5252

5353
Multiple toggle switches can be used to model multiple selections, often represented using an `Array` or `Set` containing the selected values. This can also be represented using a list, like a `<select multiple>`. Some dropdowns also support multiple selections, often in combination with a tag/chip/pill component to show the selected values when the list is collapsed.
5454

docs/exercises/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import NumbersGame from './numbers-game.vue'
77

88
# Exercises
99

10-
* [Tic-tac-toe](./tic-tac-toe.html)
11-
* [Quiz](./quiz.html)
12-
* [Minesweeper](./minesweeper.html)
13-
* [Numbers Game](./numbers-game.html)
10+
* [Tic-tac-toe](./tic-tac-toe)
11+
* [Quiz](./quiz)
12+
* [Minesweeper](./minesweeper)
13+
* [Numbers Game](./numbers-game)
1414

1515
These exercises are intended for programmers new to Vue to practice their skills. You should read through the [official Vue documentation](https://vuejs.org/) first. Keep the documentation open while working on these exercises, as you'll likely need to look things up as you go.
1616

docs/index.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (typeof window !== 'undefined') {
66

77
if (['#component-libraries', '#component-libraries-notes'].includes(hash)) {
88
onMounted(() => {
9-
window.location = './component-libraries.html' + hash
9+
window.location = './component-libraries' + hash
1010
})
1111
}
1212
}
@@ -31,23 +31,23 @@ In pretty much all cases, the styling and accessibility of these components is n
3131

3232
## Example components
3333

34-
* [Checkbox](./components/checkbox.html)
35-
* [Radio](./components/radio.html)
36-
* [Toggle Switch](./components/toggle-switch.html)
37-
* [Radio Group](./components/radio-group.html)
38-
* [Accordion](./components/accordion.html)
39-
* [Tabs](./components/tabs.html)
34+
* [Checkbox](./components/checkbox)
35+
* [Radio](./components/radio)
36+
* [Toggle Switch](./components/toggle-switch)
37+
* [Radio Group](./components/radio-group)
38+
* [Accordion](./components/accordion)
39+
* [Tabs](./components/tabs)
4040

4141
## Patterns
4242

43-
* [Computed with v-model](./patterns/computed-v-model.html)
44-
* [Global Properties](./patterns/global-properties.html)
45-
* [Coupled Components with `provide`/`inject`](./patterns/coupled-components-with-provide-inject.html)
43+
* [Computed with v-model](./patterns/computed-v-model)
44+
* [Global Properties](./patterns/global-properties)
45+
* [Coupled Components with `provide`/`inject`](./patterns/coupled-components-with-provide-inject)
4646

4747
## Guides
4848

49-
* [Working with Image Assets](./guides/working-with-image-assets.html)
50-
* [Understanding the Vue Source Code](./advanced/understanding-the-vue-source-code.html)
49+
* [Working with Image Assets](./guides/working-with-image-assets)
50+
* [Understanding the Vue Source Code](./advanced/understanding-the-vue-source-code)
5151

5252
## Exercises
5353

docs/patterns/computed-v-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The principle of one-way data flow, with 'props down, events up', is just an ext
1111

1212
This causes problems when working with `v-model`, which attempts to modify the value directly. One way we can address this is by using `computed()` with `get` and `set`.
1313

14-
There are more complete examples for [Checkbox](../components/checkbox.html) and [Radio](../components/radio.html) components, but to reduce it down to the essentials with an `<input>`:
14+
There are more complete examples for [Checkbox](../components/checkbox) and [Radio](../components/radio) components, but to reduce it down to the essentials with an `<input>`:
1515

1616
```vue-html
1717
<input v-model="inputValue">

docs/patterns/coupled-components-with-provide-inject.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ It's common to hear `provide` and `inject` described as 'long-range props' or 'd
66

77
The term 'coupling' is often used as a criticism of a design, but there are many cases where tightly coupled components make sense. These are cases where a particular component needs to be a child (or deeper descendant) of another, specific component. A few examples:
88

9-
1. An [accordion](../components/accordion.html) is often implemented using a parent container and expandable child panels.
10-
2. A [tabs](../components/tabs.html) component may be broken down into several smaller components, e.g. for the tab buttons and the content containers. These all need to communicate to ensure the correct thing is showing at any given time.
11-
3. A [radio group](../components/radio-group.html) or checkbox group, for communicating with the radio/checkbox children.
9+
1. An [accordion](../components/accordion) is often implemented using a parent container and expandable child panels.
10+
2. A [tabs](../components/tabs) component may be broken down into several smaller components, e.g. for the tab buttons and the content containers. These all need to communicate to ensure the correct thing is showing at any given time.
11+
3. A [radio group](../components/radio-group) or checkbox group, for communicating with the radio/checkbox children.
1212
4. A map component will need to communicate with marker components.
1313
5. A table component may need to communicate with headers, rows and cells.
1414

@@ -54,13 +54,13 @@ onUnmounted(unregister)
5454

5555
The usage pattern here is very similar to using a composable. The `register` function behaves much like a `useX` function, returning an object that contains everything the caller might need.
5656

57-
For more complete examples of this pattern, see the [accordion](../components/accordion.html) and [tabs](../components/tabs.html) components.
57+
For more complete examples of this pattern, see the [accordion](../components/accordion) and [tabs](../components/tabs) components.
5858

59-
While this registration pattern can be useful, it isn't the only way to use `provide` and `inject` for communicating between tightly coupled components. Data and functions can be passed down to emulate props and events respectively. The [Radio Group example](../components/radio-group.html) does something similar.
59+
While this registration pattern can be useful, it isn't the only way to use `provide` and `inject` for communicating between tightly coupled components. Data and functions can be passed down to emulate props and events respectively. The [Radio Group example](../components/radio-group) does something similar.
6060

6161
## Alternatives
6262

63-
Sometimes it's possible to implement this type of tight coupling using `render` functions and direct manipulation of the VNodes. That requires digging into the internals of Vue, which can lead to some unpleasant surprises if you aren't sure what you're doing. I created a library called [`@skirtle/vue-vnode-utils`](https://skirtles-code.github.io/vue-vnode-utils/) that makes this kind of VNode manipulation a little easier. There's an [accordion example](https://skirtles-code.github.io/vue-vnode-utils/examples.html#adding-component-v-model) in that library's docs that is functionally very similar to the one mentioned above.
63+
Sometimes it's possible to implement this type of tight coupling using `render` functions and direct manipulation of the VNodes. That requires digging into the internals of Vue, which can lead to some unpleasant surprises if you aren't sure what you're doing. I created a library called [`@skirtle/vue-vnode-utils`](https://skirtles-code.github.io/vue-vnode-utils/) that makes this kind of VNode manipulation a little easier. There's an [accordion example](https://skirtles-code.github.io/vue-vnode-utils/examples#adding-component-v-model) in that library's docs that is functionally very similar to the one mentioned above.
6464

6565
Another alternative is to use scoped slots, though they require the consuming template to get involved.
6666

0 commit comments

Comments
 (0)