You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/checkbox.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ The wrapper `<div>` will receive any extra attributes specified on the parent, i
92
92
93
93
## Related Components
94
94
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).
96
96
97
97
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.
Copy file name to clipboardExpand all lines: docs/components/radio-group.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,11 +54,11 @@ The `radio.vue` here is specially written to use `inject` instead of a `modelVal
54
54
55
55
<<< @/components/radio-group/radio.vue
56
56
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.
58
58
59
59
## Vue Patterns
60
60
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)
62
62
63
63
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.
Copy file name to clipboardExpand all lines: docs/components/toggle-switch.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The implementation includes a lot of CSS, but it is otherwise very similar to a
48
48
49
49
## Related Components
50
50
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).
52
52
53
53
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.
Copy file name to clipboardExpand all lines: docs/exercises/index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ import NumbersGame from './numbers-game.vue'
7
7
8
8
# Exercises
9
9
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)
14
14
15
15
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.
Copy file name to clipboardExpand all lines: docs/patterns/computed-v-model.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ The principle of one-way data flow, with 'props down, events up', is just an ext
11
11
12
12
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`.
13
13
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>`:
Copy file name to clipboardExpand all lines: docs/patterns/coupled-components-with-provide-inject.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ It's common to hear `provide` and `inject` described as 'long-range props' or 'd
6
6
7
7
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:
8
8
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.
12
12
4. A map component will need to communicate with marker components.
13
13
5. A table component may need to communicate with headers, rows and cells.
14
14
@@ -54,13 +54,13 @@ onUnmounted(unregister)
54
54
55
55
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.
56
56
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.
58
58
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.
60
60
61
61
## Alternatives
62
62
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.
64
64
65
65
Another alternative is to use scoped slots, though they require the consuming template to get involved.
0 commit comments