Skip to content

Commit 6f574eb

Browse files
authored
docs: Add warning on docs version (#1792)
* Add warning on docs version * Remove unnecessary wrapper
1 parent 58b9956 commit 6f574eb

File tree

3 files changed

+65
-4
lines changed

3 files changed

+65
-4
lines changed

docs/.vuepress/theme/Layout.vue

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<template>
2+
<ParentLayout>
3+
<template #page-top>
4+
<div class="warning-wrapper">
5+
<div class="custom-block warning vue3-warning">
6+
<p>
7+
You’re browsing the documentation for Vue Test Utils for Vue v2.x
8+
and earlier.
9+
</p>
10+
<p>
11+
To read docs for Vue Test Utils for Vue 3,
12+
<a
13+
href="https://next.vue-test-utils.vuejs.org/introduction/"
14+
v-text="'click here'"
15+
/>.
16+
</p>
17+
</div>
18+
</div>
19+
</template>
20+
<Content />
21+
</ParentLayout>
22+
</template>
23+
24+
<script>
25+
import ParentLayout from '@parent-theme/layouts/Layout.vue'
26+
27+
export default {
28+
name: 'Layout',
29+
30+
components: {
31+
ParentLayout
32+
}
33+
}
34+
</script>
35+
36+
<style lang="css">
37+
.warning-wrapper {
38+
max-width: 740px;
39+
margin: 5rem auto 0;
40+
}
41+
42+
.custom-block.vue3-warning {
43+
padding: 1rem;
44+
font-size: 0.9rem;
45+
}
46+
47+
.custom-block.vue3-warning p {
48+
margin: 0;
49+
}
50+
51+
/* Overrides theme's default margin-top values */
52+
.theme-default-content:not(.custom) > h1:first-child {
53+
margin-top: -4.5rem;
54+
}
55+
</style>

docs/.vuepress/theme/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extend: '@vuepress/theme-default'
3+
}

docs/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Introduction
22

3-
::: warning
4-
This doc is for Vue2.x only. If you want to see docs related to 3.x, please move to [here](https://next.vue-test-utils.vuejs.org/introduction/)
5-
:::
6-
73
Vue Test Utils is the official unit testing utility library for Vue.js.
84

5+
This is the documentation for Vue Test Utils v1, which targets Vue 2 and earlier.
6+
7+
In short:
8+
9+
- [Vue Test Utils 1](https://github.com/vuejs/vue-test-utils/) targets [Vue 2](https://github.com/vuejs/vue/).
10+
- [Vue Test Utils 2](https://github.com/vuejs/vue-test-utils-next/) targets [Vue 3](https://github.com/vuejs/vue-next/).
11+
912
<div class="vueschool"><a href="https://vueschool.io/courses/learn-how-to-test-vuejs-components?friend=vuejs" target="_blank" rel="sponsored noopener" title="Learn how to use Vue Test Utils to test Vue.js Components with Vue School">Learn how to test Vue.js components with Vue School</a></div>
1013

1114
- [Installation](./installation/)

0 commit comments

Comments
 (0)