Skip to content

Commit e6512dc

Browse files
committed
fix: avoid badge text showing up in anchor hrefs
1 parent 99e3aac commit e6512dc

18 files changed

+48
-27
lines changed

.vitepress/theme/styles/badges.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
.vt-badge.wip:before {
2+
content: 'WIP';
3+
}
4+
15
.vt-badge.ts {
26
background-color: #3178c6;
37
}
8+
.vt-badge.ts:before {
9+
content: 'TS';
10+
}
11+
12+
.vt-badge.dev-only,
13+
.vt-badge.experimental {
14+
color: var(--vt-c-text-light-1);
15+
background-color: var(--vt-c-yellow);
16+
}
17+
18+
.vt-badge.dev-only:before {
19+
content: 'Dev only';
20+
}
21+
22+
.vt-badge.experimental:before {
23+
content: 'Experimental';
24+
}

src/about/v2-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Vue 2 vs. Vue 3 FAQ <sup class="vt-badge">WIP</sup>
1+
# Vue 2 vs. Vue 3 FAQ <sup class="vt-badge wip" />

src/api/built-in-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Renders its slot content to another part of the DOM.
301301

302302
- **See also:** [Guide - Teleport](/guide/built-ins/teleport.html)
303303

304-
## `<Suspense>` <sup class="vt-badge warning">experimental</sup>
304+
## `<Suspense>` <sup class="vt-badge experimental" />
305305

306306
Used for orchestrating nested async dependencies in a component tree.
307307

src/api/composition-api-lifecycle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Registers a hook to be called when an error propagating from a descendent compon
220220

221221
- An `errorCaptured` hook can return `false` to prevent the error from propagating further. This is essentially saying "this error has been handled and should be ignored." It will prevent any additional `errorCaptured` hooks or `app.config.errorHandler` from being invoked for this error.
222222

223-
## onRenderTracked() <sup class="vt-badge warning">Dev only</sup>
223+
## onRenderTracked() <sup class="vt-badge dev-only" />
224224

225225
Registers a debug hook to be called when a reactive dependency has been tracked by the component's render effect.
226226

@@ -243,7 +243,7 @@ Registers a debug hook to be called when a reactive dependency has been tracked
243243

244244
- **See also:** [Reactivity in Depth](/guide/extras/reactivity-in-depth.html)
245245

246-
## onRenderTriggered() <sup class="vt-badge warning">Dev only</sup>
246+
## onRenderTriggered() <sup class="vt-badge dev-only" />
247247

248248
Registers a debug hook to be called when a reactive dependency triggers the component's render effect to be re-run.
249249

src/api/options-lifecycle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Called when an error propagating from a descendent component has been captured.
209209

210210
- An `errorCaptured` hook can return `false` to prevent the error from propagating further. This is essentially saying "this error has been handled and should be ignored." It will prevent any additional `errorCaptured` hooks or `app.config.errorHandler` from being invoked for this error.
211211

212-
## renderTracked <sup class="vt-badge warning">Dev only</sup>
212+
## renderTracked <sup class="vt-badge dev-only" />
213213

214214
Called when a reactive dependency has been tracked by the component's render effect.
215215

@@ -230,7 +230,7 @@ Called when a reactive dependency has been tracked by the component's render eff
230230
231231
- **See also:** [Reactivity in Depth](/guide/extras/reactivity-in-depth.html)
232232
233-
## renderTriggered <sup class="vt-badge warning">Dev only</sup>
233+
## renderTriggered <sup class="vt-badge dev-only" />
234234
235235
Called when a reactive dependency triggers the component's render effect to be re-run.
236236

src/api/sfc-script-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ In addition, the awaited expression will be automatically compiled in a format t
230230
`async setup()` must be used in combination with `Suspense`, which is currently still an experimental feature. We plan to finalize and document it in a future release - but if you are curious now, you can refer to its [tests](https://github.com/vuejs/core/blob/main/packages/runtime-core/__tests__/components/Suspense.spec.ts) to see how it works.
231231
:::
232232

233-
## TypeScript-only Features <sup class="vt-badge ts">TS</sup>
233+
## TypeScript-only Features <sup class="vt-badge ts" />
234234

235235
### Type-only props/emit declarations
236236

src/guide/components/events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const emit = defineEmits<{
146146
</script>
147147
```
148148

149-
More details: [Typing Component Emits](/guide/typescript/composition-api.html#typing-component-emits) <sup class="vt-badge ts">TS</sup>
149+
More details: [Typing Component Emits](/guide/typescript/composition-api.html#typing-component-emits) <sup class="vt-badge ts" />
150150

151151
</div>
152152
<div class="options-api">
@@ -162,7 +162,7 @@ export default {
162162
}
163163
```
164164

165-
See also: [Typing Component Emits](/guide/typescript/options-api.html#typing-component-emits) <sup class="vt-badge ts">TS</sup>
165+
See also: [Typing Component Emits](/guide/typescript/options-api.html#typing-component-emits) <sup class="vt-badge ts" />
166166

167167
</div>
168168

src/guide/components/props.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ This not only documents your component, but will also warn other developers usin
9292

9393
<div class="options-api">
9494

95-
See also: [Typing Component Props](/guide/typescript/options-api.html#typing-component-props) <sup class="vt-badge ts">TS</sup>
95+
See also: [Typing Component Props](/guide/typescript/options-api.html#typing-component-props) <sup class="vt-badge ts" />
9696

9797
</div>
9898

@@ -109,7 +109,7 @@ defineProps<{
109109
</script>
110110
```
111111

112-
More details: [Typing Component Props](/guide/typescript/composition-api.html#typing-component-props) <sup class="vt-badge ts">TS</sup>
112+
More details: [Typing Component Props](/guide/typescript/composition-api.html#typing-component-props) <sup class="vt-badge ts" />
113113

114114
</div>
115115

src/guide/components/provide-inject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ import { myInjectionKey } from './keys.js'
350350
const injected = inject(myInjectionKey)
351351
```
352352

353-
See also: [Typing Provide / Inject](/guide/typescript/composition-api.html#typing-provide-inject) <sup class="vt-badge ts">TS</sup>
353+
See also: [Typing Provide / Inject](/guide/typescript/composition-api.html#typing-provide-inject) <sup class="vt-badge ts" />
354354

355355
</div>
356356

src/guide/essentials/component-basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ const props = defineProps(['title'])
219219
console.log(props.title)
220220
```
221221

222-
See also: [Typing Component Props](/guide/typescript/composition-api.html#typing-component-props) <sup class="vt-badge ts">TS</sup>
222+
See also: [Typing Component Props](/guide/typescript/composition-api.html#typing-component-props) <sup class="vt-badge ts" />
223223

224224
If you are not using `<script setup>`, props should be declared using the `props` option, and the props object will be passed to `setup()` as the first argument:
225225

@@ -430,7 +430,7 @@ const emit = defineEmits(['enlarge-text'])
430430
emit('enlarge-text')
431431
```
432432

433-
See also: [Typing Component Emits](/guide/typescript/composition-api.html#typing-component-emits) <sup class="vt-badge ts">TS</sup>
433+
See also: [Typing Component Emits](/guide/typescript/composition-api.html#typing-component-emits) <sup class="vt-badge ts" />
434434

435435
If you are not using `<script setup>`, you can declare emitted events using the `emits` option. You can access the `emit` function as a property of the setup context (passed to `setup()` as the second argument):
436436

src/guide/essentials/computed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Try to change the value of the `books` array in the application `data` and you w
8989

9090
You can data-bind to computed properties in templates just like a normal property. Vue is aware that `this.publishedBooksMessage` depends on `this.author.books`, so it will update any bindings that depend on `this.publishedBooksMessage` when `this.author.books` changes.
9191

92-
See also: [Typing Computed Properties](/guide/typescript/options-api.html#typing-computed) <sup class="vt-badge ts">TS</sup>
92+
See also: [Typing Computed Properties](/guide/typescript/options-api.html#typing-computed) <sup class="vt-badge ts" />
9393

9494
</div>
9595

@@ -126,7 +126,7 @@ Here we have declared a computed property `publishedBooksMessage`. The `computed
126126

127127
A computed property automatically tracks its reactive dependencies. Vue is aware that the computation of `publishedBooksMessage` depends on `author.books`, so it will update any bindings that depend on `publishedBooksMessage` when `author.books` changes.
128128

129-
See also: [Typing Computed](/guide/typescript/composition-api.html#typing-computed) <sup class="vt-badge ts">TS</sup>
129+
See also: [Typing Computed](/guide/typescript/composition-api.html#typing-computed) <sup class="vt-badge ts" />
130130

131131
</div>
132132

src/guide/essentials/event-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ A method handler automatically receives the native DOM Event object that trigger
112112

113113
<div class="composition-api">
114114

115-
See also: [Typing Event Handlers](/guide/typescript/composition-api.html#typing-event-handlers) <sup class="vt-badge ts">TS</sup>
115+
See also: [Typing Event Handlers](/guide/typescript/composition-api.html#typing-event-handlers) <sup class="vt-badge ts" />
116116

117117
</div>
118118
<div class="options-api">
119119

120-
See also: [Typing Event Handlers](/guide/typescript/options-api.html#typing-event-handlers) <sup class="vt-badge ts">TS</sup>
120+
See also: [Typing Event Handlers](/guide/typescript/options-api.html#typing-event-handlers) <sup class="vt-badge ts" />
121121

122122
</div>
123123

src/guide/essentials/reactivity-fundamentals.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const state = reactive({ count: 0 })
7777

7878
Reactive objects are [JavaScript Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) and behave just like normal objects. The difference is that Vue is able to track the property access and mutations of a reactive object. If you are curious about the details, we explain how Vue's reactivity system works in [Reactivity in Depth](/guide/extras/reactivity-in-depth.html) - but we recommend reading it after you have finished the main guide.
7979

80-
See also: [Typing Reactive](/guide/typescript/composition-api.html#typing-reactive) <sup class="vt-badge ts">TS</sup>
80+
See also: [Typing Reactive](/guide/typescript/composition-api.html#typing-reactive) <sup class="vt-badge ts" />
8181

8282
To use reactive state in a component's template, declare and return them from a component's `setup()` function:
8383

@@ -388,7 +388,7 @@ count.value++
388388
console.log(count.value) // 1
389389
```
390390

391-
See also: [Typing Refs](/guide/typescript/composition-api.html#typing-ref) <sup class="vt-badge ts">TS</sup>
391+
See also: [Typing Refs](/guide/typescript/composition-api.html#typing-ref) <sup class="vt-badge ts" />
392392

393393
Similar to properties on a reactive object, the `.value` property of a ref is reactive. In addition, when holding object types, ref automatically converts its `.value` with `reactive()`.
394394

@@ -555,7 +555,7 @@ export default {
555555

556556
<div class="composition-api">
557557

558-
## Reactivity Transform <sup class="vt-badge warning">experimental</sup> \*\*
558+
## Reactivity Transform <sup class="vt-badge experimental" /> \*\*
559559

560560
Having to use `.value` with refs is a drawback imposed by the language constraints of JavaScript. However, with compile-time transforms we can improve the ergonomics by automatically appending `.value` in appropriate locations. Vue provides a compile-time transform that allows us to write the ealier "counter" example like this:
561561

src/guide/essentials/template-refs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ watchEffect(() => {
6969
})
7070
```
7171

72-
See also: [Typing Template Refs](/guide/typescript/composition-api.html#typing-template-refs) <sup class="vt-badge ts">TS</sup>
72+
See also: [Typing Template Refs](/guide/typescript/composition-api.html#typing-template-refs) <sup class="vt-badge ts" />
7373

7474
</div>
7575

@@ -222,7 +222,7 @@ defineExpose({
222222

223223
When a parent gets an instance of this component via template refs, the retrieved instance will be of the shape `{ a: number, b: number }` (refs are automatically unwrapped just like on normal instances).
224224

225-
See also: [Typing Component Template Refs](/guide/typescript/composition-api.html#typing-component-template-refs) <sup class="vt-badge ts">TS</sup>
225+
See also: [Typing Component Template Refs](/guide/typescript/composition-api.html#typing-component-template-refs) <sup class="vt-badge ts" />
226226

227227
</div>
228228
<div class="options-api">

src/guide/extras/reactivity-transform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ setup(props) {
265265
}
266266
```
267267

268-
## TypeScript Integration <sup class="vt-badge ts">TS</sup>
268+
## TypeScript Integration <sup class="vt-badge ts" />
269269

270270
Vue provides typings for these macros (available globally) and all types will work as expected. There are no incompatibilities with standard TypeScript semantics so the syntax would work with all existing tooling.
271271

src/guide/reusability/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Our `$translate` function will take a string such as `greetings.hello`, look ins
8585
<h1>{{ $translate('greetings.hello') }}</h1>
8686
```
8787

88-
See also: [Augmenting Global Properties](/guide/typescript/options-api.html#augmenting-global-properties) <sup class="vt-badge ts">TS</sup>
88+
See also: [Augmenting Global Properties](/guide/typescript/options-api.html#augmenting-global-properties) <sup class="vt-badge ts" />
8989

9090
:::tip
9191
Use global properties scarcely, since it can quickly become confusing if too many global properties injected by different plugins are used throughout an app.

src/guide/typescript/composition-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ In order to generate the correct runtime code, the generic argument for `defineP
5757
The same-file limitation could be removed in a future release.
5858
:::
5959

60-
### Props Default Values <sup class="vt-badge warning">experimental</sup>
60+
### Props Default Values <sup class="vt-badge experimental" />
6161

6262
When using type-based declaration, we lose the ability to declare default values for the props. This can be resolved by the currently experimental [Reactivity Transform](/guide/extras/reactivity-transform.html):
6363

src/translations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
aside: false
33
---
44

5-
# Translations <sup class="vt-badge">WIP</sup>
5+
# Translations <sup class="vt-badge wip" />
66

77
The Vue documentation has recently undergone a major revision, so there are no completed translations in other languages yet.
88

0 commit comments

Comments
 (0)