Skip to content

Commit cd1dcfe

Browse files
committed
Fix badge click, unify implementation
1 parent ebcaa5d commit cd1dcfe

File tree

7 files changed

+27
-12
lines changed

7 files changed

+27
-12
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
2-
<Badge
2+
<StatusBadge
33
type="danger"
44
text="Alpha"
55
title="Alpha features are experimental. They may never be generally available. If released subsequently, the APIs and behavior might change."
6-
onclick="location = '../get-started/learning-sources#feature-status-badges'" style="cursor: pointer"
76
/>
87
</template>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
2-
<Badge
2+
<StatusBadge
33
type="warning"
44
text="Beta"
55
title="Beta features are planned to be generally available in subsequent releases, however, APIs and their behavior are not final and may change in the general release."
6-
onclick="location = '../get-started/learning-sources#feature-status-badges'" style="cursor: pointer"
76
/>
87
</template>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
2-
<Badge
2+
<StatusBadge
33
type="info"
44
text="Concept"
55
title="Concept features are ideas for potential future enhancements and an opportunity for you to give feedback. This is not a commitment to implement the feature though."
6-
onclick="location = '../get-started/learning-sources#feature-status-badges'" style="cursor: pointer"
76
/>
87
</template>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<template>
2-
<Badge
2+
<StatusBadge
33
type="tip"
44
text="Gamma"
55
title="Gamma features are finalized and ready to use, stable, and supported long term. Yet, as they have a broad scope and range, you should ensure to test them thoroughly."
6-
onclick="location = '../get-started/learning-sources#feature-status-badges'" style="cursor: pointer"
76
/>
87
</template>

.vitepress/theme/components/Since.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<Badge
3-
type="tip"
4-
:text="`Since ${of} ${version}`"
5-
:title="`This feature is only available as of ${of} version ${version} or higher.`"
2+
<StatusBadge
3+
type="tip"
4+
:text="`Since ${of} ${version}`"
5+
:title="`This feature is only available as of ${of} version ${version} or higher.`"
66
/>
77
</template>
88

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<Badge
3+
:type="type"
4+
:text="text"
5+
:title="title"
6+
@click="click" style="cursor: pointer"
7+
/>
8+
</template>
9+
10+
<script setup lang="ts">
11+
defineProps<{ type: string, text:string, title:string }>()
12+
13+
import { withBase } from 'vitepress'
14+
function click() {
15+
location.href = withBase('../get-started/learning-sources#feature-status-badges')
16+
}
17+
</script>

.vitepress/theme/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { EnhanceAppContext } from 'vitepress';
33
import Layout from './Layout.vue';
44
import IndexList from './components/IndexList.vue';
55
import ImplVariantsHint from './components/implvariants/ImpVariantsHint.vue';
6+
import StatusBadge from './components/StatusBadge.vue';
67
import Alpha from './components/Alpha.vue';
78
import Beta from './components/Beta.vue';
89
import Gamma from './components/Gamma.vue';
@@ -26,6 +27,7 @@ export default {
2627
ctx.app.component('Config', CfgInspect)
2728
ctx.app.component('IndexList', IndexList)
2829
ctx.app.component('ImplVariantsHint', ImplVariantsHint)
30+
ctx.app.component('StatusBadge', StatusBadge)
2931
ctx.app.component('Alpha', Alpha)
3032
ctx.app.component('Beta', Beta)
3133
ctx.app.component('Gamma', Gamma)

0 commit comments

Comments
 (0)