Skip to content

Commit 2cc09cb

Browse files
committed
docs: hide all the style-guide links until it's ready
1 parent f9c82f4 commit 2cc09cb

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/guide/essentials/conditional.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ Generally speaking, `v-if` has higher toggle costs while `v-show` has higher ini
111111
## `v-if` with `v-for` {#v-if-with-v-for}
112112

113113
::: warning Note
114-
It's **not** recommended to use `v-if` and `v-for` on the same element due to implicit precedence. Refer to [style guide](/style-guide/rules-essential#avoid-v-if-with-v-for) for details.
114+
It's **not** recommended to use `v-if` and `v-for` on the same element due to implicit precedence.
115+
116+
There are two common cases where this can be tempting:
117+
118+
- To filter items in a list (e.g. `v-for="user in users" v-if="user.isActive"`). In these cases, replace `users` with a new computed property that returns your filtered list (e.g. `activeUsers`).
119+
120+
- To avoid rendering a list if it should be hidden (e.g. `v-for="user in users" v-if="shouldShowUsers"`). In these cases, move the `v-if` to a container element (e.g. `ul`, `ol`).
115121
:::
116122

117123
When `v-if` and `v-for` are both used on the same element, `v-if` will be evaluated first. See the [list rendering guide](list#v-for-with-v-if) for details.

src/guide/essentials/list.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,13 @@ Similar to template `v-if`, you can also use a `<template>` tag with `v-for` to
224224
## `v-for` with `v-if` {#v-for-with-v-if}
225225

226226
:::warning Note
227-
It's **not** recommended to use `v-if` and `v-for` on the same element due to implicit precedence. Refer to [style guide](/style-guide/rules-essential#avoid-v-if-with-v-for) for details.
227+
It's **not** recommended to use `v-if` and `v-for` on the same element due to implicit precedence.
228+
229+
There are two common cases where this can be tempting:
230+
231+
- To filter items in a list (e.g. `v-for="user in users" v-if="user.isActive"`). In these cases, replace `users` with a new computed property that returns your filtered list (e.g. `activeUsers`).
232+
233+
- To avoid rendering a list if it should be hidden (e.g. `v-for="user in users" v-if="shouldShowUsers"`). In these cases, move the `v-if` to a container element (e.g. `ul`, `ol`).
228234
:::
229235

230236
When they exist on the same node, `v-if` has a higher priority than `v-for`. That means the `v-if` condition will not have access to variables from the scope of the `v-for`:
@@ -275,7 +281,7 @@ When using `<template v-for>`, the `key` should be placed on the `<template>` co
275281
`key` here is a special attribute being bound with `v-bind`. It should not be confused with the property key variable when [using `v-for` with an object](#v-for-with-an-object).
276282
:::
277283

278-
[It is recommended](/style-guide/rules-essential#use-keyed-v-for) to provide a `key` attribute with `v-for` whenever possible, unless the iterated DOM content is simple (i.e. contains no components or stateful DOM elements), or you are intentionally relying on the default behavior for performance gains.
284+
It is recommended to provide a `key` attribute with `v-for` whenever possible, unless the iterated DOM content is simple (i.e. contains no components or stateful DOM elements), or you are intentionally relying on the default behavior for performance gains.
279285

280286
The `key` binding expects primitive values - i.e. strings and numbers. Do not use objects as `v-for` keys. For detailed usage of the `key` attribute, please see the [`key` API documentation](/api/built-in-special-attributes#key).
281287

0 commit comments

Comments
 (0)