Skip to content

Commit 9458584

Browse files
committed
Merge branch 'resolve-route' into route-option
2 parents 8ce1d27 + c72ad20 commit 9458584

23 files changed

+246
-75
lines changed

e2e/docs/.vuepress/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { viteBundler } from '@vuepress/bundler-vite'
33
import { webpackBundler } from '@vuepress/bundler-webpack'
44
import { defineUserConfig } from 'vuepress'
55
import { path } from 'vuepress/utils'
6+
import { fooPlugin } from './plugins/foo/fooPlugin.js'
67
import { e2eTheme } from './theme/node/e2eTheme.js'
78

89
const E2E_BASE = (process.env.E2E_BASE ?? '/') as '/' | `/${string}/`
@@ -80,4 +81,6 @@ export default defineUserConfig({
8081
}
8182
}
8283
},
84+
85+
plugins: [fooPlugin],
8386
})
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { getDirname, path } from 'vuepress/utils'
2+
3+
const __dirname = getDirname(import.meta.url)
4+
5+
export const fooPlugin = {
6+
name: 'test-plugin',
7+
clientConfigFile: path.resolve(
8+
__dirname,
9+
'./nonDefaultExportClientConfig.js',
10+
),
11+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// test non-default-export clientConfig
2+
import './test.css'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#non-default-export {
2+
font-size: 123px;
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<template>
22
<div class="e2e-theme-not-found">404 Not Found</div>
3+
<div class="e2e-theme-not-found-content"><Content /></div>
34
</template>

e2e/docs/404.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
routeMeta:
33
foo: bar
44
---
5+
6+
## NotFound H2

e2e/docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
foo
2+
3+
## Home H2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# non-default-export

e2e/docs/router/navigate-by-link.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Markdown Links with html
2+
3+
- [Home with query](/?home=true)
4+
- [Home with query and hash](/?home=true#home)
5+
- [404 with hash](/404.html#404)
6+
- [404 with hash and query](/404.html#404?notFound=true)
7+
8+
## Markdown Links with md
9+
10+
- [Home with query](/README.md?home=true)
11+
- [Home with query and hash](/README.md?home=true#home)
12+
- [404 with hash](/404.md#404)
13+
- [404 with hash and query](/404.md#404?notFound=true)
14+
15+
## HTML Links
16+
17+
<a href="/?home=true" class="home-with-query">Home</a>
18+
<a href="/?home=true#home" class="home-with-query-and-hash">Home</a>
19+
<a href="/404.html#404" class="not-found-with-hash">404</a>
20+
<a href="/404.html#404?notFound=true" class="not-found-with-hash-and-query">404</a>

e2e/docs/router/navigate-by-router.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<button id="home-with-query" @click="goHomeWithQuery">Home</button>
2+
<button id="home-with-query-and-hash" @click="goHomeWithQueryAndHash">Home</button>
3+
<button id="not-found-with-hash" @click="go404WithHash">404</button>
4+
<button id="not-found-with-hash-and-query" @click="go404WithHashAndQuery">404</button>
5+
6+
<script setup lang="ts">
7+
import { useRouter } from 'vuepress/client';
8+
9+
const router = useRouter();
10+
11+
const goHomeWithQuery = () => {
12+
router.push('/?home=true');
13+
}
14+
15+
const goHomeWithQueryAndHash = () => {
16+
router.push('/?home=true#home');
17+
}
18+
19+
const go404WithHash = () => {
20+
router.push('/404.html#404');
21+
}
22+
23+
const go404WithHashAndQuery = () => {
24+
router.push('/404.html#404?notFound=true');
25+
}
26+
</script>

0 commit comments

Comments
 (0)