Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 9d6e391

Browse files
authored
Merge pull request bootstrap-vue-next#1117 from VividLemon/main
docs: migration wrapper
2 parents 79b6ac9 + 55394c1 commit 9d6e391

File tree

3 files changed

+68
-7
lines changed

3 files changed

+68
-7
lines changed
+23-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
<template>
2-
<b-card> {{ $props }} </b-card>
2+
<b-card>
3+
<template #header>
4+
<div class="mb-2">
5+
<h3>{{ component }} - {{ change }}</h3>
6+
</div>
7+
<b-badge :variant="difficultyVariant">{{ difficulty }}</b-badge>
8+
</template>
9+
<div class="mb-2">
10+
<h4>Rationale:</h4>
11+
{{ rationale }}
12+
</div>
13+
<h4>Fix:</h4>
14+
{{ fix }}
15+
</b-card>
316
</template>
417

518
<script setup lang="ts">
6-
import {BCard} from 'bootstrap-vue-next'
19+
import {computed} from 'vue'
20+
import {BBadge, BCard, type ColorVariant} from 'bootstrap-vue-next'
721
8-
defineProps<{
9-
difficulty: 'hard' | 'normal' | 'easy'
22+
const props = defineProps<{
23+
difficulty: 'hard' | 'medium' | 'easy'
1024
component: string
25+
change: string
1126
/**
1227
* The rationale for the change
1328
*/
1429
rationale: string
1530
fix: string
16-
description: string
1731
}>()
32+
33+
const difficultyVariant = computed<ColorVariant>(() =>
34+
props.difficulty === 'hard' ? 'danger' : props.difficulty === 'medium' ? 'warning' : 'success'
35+
)
1836
</script>

apps/docs/src/migration-guide.md

+45-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
# Hello World
1+
# Migration Guide
2+
3+
<migration-wrapper v-for="(item, i) in changes" :key="i" v-bind="item" class="my-3" />
4+
5+
<script setup lang="ts">
6+
import {computed} from 'vue'
7+
import MigrationWrapper from './components/MigrationWrapper.vue'
8+
9+
const changes = computed<{
10+
difficulty: 'hard' | 'medium' | 'easy'
11+
component: string
12+
change: string
13+
/**
14+
* The rationale for the change
15+
*/
16+
rationale: string
17+
fix: string
18+
description: string
19+
}[]>(() => [
20+
{
21+
change: 'subTitle prop renamed to subtitle',
22+
fix: "Any instances of using prop 'subTitle' on BCard should be replaced with 'subtitle'",
23+
component: 'BCard',
24+
difficulty: 'easy',
25+
rationale:
26+
"The word 'subtitle' is a single word. CamelCase of the word 'subTitle' indicates that it would be multi word, sub & title. This is incorrect",
27+
},
28+
{
29+
change: 'subTitleTag prop renamed to subtitleTag',
30+
fix: "Any instances of using prop 'subTitleTag' on BCard should be replaced with 'subtitleTag'",
31+
component: 'BCard',
32+
difficulty: 'easy',
33+
rationale:
34+
"The word 'subtitle' is a single word. CamelCase of the word 'subTitle' indicates that it would be multi word, sub & title. This is incorrect",
35+
},
36+
{
37+
change: 'subTitleTextVariant prop renamed to subtitleTextVariant',
38+
fix: "Any instances of using prop 'subTitleTextVariant' on BCard should be replaced with 'subtitleTextVariant'",
39+
component: 'BCard',
40+
difficulty: 'easy',
41+
rationale:
42+
"The word 'subtitle' is a single word. CamelCase of the word 'subTitle' indicates that it would be multi word, sub & title. This is incorrect",
43+
},
44+
].sort((a, b) => a.component.localeCompare(b.component)))
45+
</script>

apps/docs/src/reference/migrate.md

-1
This file was deleted.

0 commit comments

Comments
 (0)