25 |
37 |
47 |
48 |
${hash}
。',
15 | }
16 |
17 | const theme: Theme = {
18 | extends: DefaultTheme,
19 | Layout() {
20 | return h(DefaultTheme.Layout, null, {
21 | // 'home-features-after': () => h(HomeSponsors),
22 | 'aside-ads-before': () => h(AsideSponsors),
23 | 'doc-before': () => h(TranslationStatus, { status, i18nLabels }),
24 | 'layout-top': () => h(MadVueBanner),
25 | })
26 | },
27 |
28 | enhanceApp({ app }) {
29 | app.component('VueSchoolLink', VueSchoolLink)
30 | app.component('VueMasteryLogoLink', VueMasteryLogoLink)
31 | },
32 |
33 | // TODO: real date
34 | // setup() {
35 | // const { lang } = useData()
36 | // watchEffect(() => {
37 | // if (typeof document !== 'undefined') {
38 | // document.cookie = `nf_lang=${lang.value}; expires=Sun, 1 Jan 2023 00:00:00 UTC; path=/`
39 | // }
40 | // })
41 | // },
42 | }
43 |
44 | export default theme
45 |
--------------------------------------------------------------------------------
/packages/docs/.vitepress/theme/styles/home-links.css:
--------------------------------------------------------------------------------
1 | /* Style to get the cheat sheet link in the home page */
2 |
3 | a.cta {
4 | text-align: center;
5 | border-radius: 8px;
6 | }
7 |
8 | a.cta:hover {
9 | border-color: var(--vp-c-brand);
10 | background-color: var(--c-bg-accent);
11 | }
12 |
13 | a.cta.vue-mastery::before {
14 | content: '';
15 | display: inline-block;
16 | width: 25px;
17 | height: 25px;
18 | background-image: url('https://firebasestorage.googleapis.com/v0/b/vue-mastery.appspot.com/o/flamelink%2Fmedia%2Fvue-mastery-logo-small.png?alt=media&token=941fcc3a-2b6f-40e9-b4c8-56b3890da108');
19 | background-size: 25px;
20 | background-repeat: no-repeat;
21 | background-position: bottom;
22 | margin-right: 0.5em;
23 | }
24 |
25 | a.cta.vueschool {
26 | position: relative;
27 | color: currentColor;
28 | padding-left: 38px !important;
29 | }
30 | a.cta.vueschool::before {
31 | content: '';
32 | position: absolute;
33 | display: block;
34 | width: 20px;
35 | height: 20px;
36 | top: calc(50% - 10px);
37 | left: 12px;
38 | border-radius: 50%;
39 | border: 1px solid currentColor;
40 | }
41 |
42 | a.cta.vueschool::after {
43 | content: '';
44 | position: absolute;
45 | display: block;
46 | width: 0;
47 | height: 0;
48 | top: calc(50% - 4px);
49 | left: 20px;
50 | border-top: 4px solid transparent;
51 | border-bottom: 4px solid transparent;
52 | border-left: 7px solid currentColor;
53 | }
54 |
55 | @media (max-width: 420px) {
56 | a.cta.cta.vue-mastery {
57 | max-width: 320px;
58 | line-height: 1.5em;
59 | white-space: normal;
60 | display: block;
61 | padding-bottom: 10px;
62 | margin-left: 8px;
63 | margin-right: 8px;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/packages/docs/.vitepress/theme/styles/vars.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --vp-c-brand-1: var(--vp-c-green-1);
3 | --vp-c-brand-2: var(--vp-c-green-2);
4 | --vp-c-brand-3: var(--vp-c-green-3);
5 | --vp-c-brand-soft: var(--vp-c-green-soft);
6 | --vp-code-color: #476582;
7 | }
8 |
9 | :root.dark {
10 | --vp-code-color: #c9def1;
11 |
12 | --vp-home-hero-image-filter: blur(72px);
13 | --vp-home-hero-image-background-image: linear-gradient(
14 | 0deg,
15 | var(--vp-c-brand-soft) 50%,
16 | var(--vp-c-brand-soft) 50%
17 | );
18 | }
19 |
--------------------------------------------------------------------------------
/packages/docs/.vitepress/translation-status.json:
--------------------------------------------------------------------------------
1 | {
2 | "zh": {
3 | "hash": "d842b6f",
4 | "date": "2024-05-17"
5 | }
6 | }
--------------------------------------------------------------------------------
/packages/docs/guide/advanced/router-view-slot.md:
--------------------------------------------------------------------------------
1 | # RouterView slot
2 |
3 | The RouterView component exposes a slot that can be used to render the route component:
4 |
5 | ```vue-html
6 | Some slotted content
57 |Some slotted content
57 |Here is the data: {{ fromApi }}
4 | other {{ other }} 5 |{{ $route.fullPath }}5 |
try to leave
4 |So far, you tried {{ tries }}
5 |My Data is: {{ someData }}
5 |I waited for {{ waited }}
6 | toggle: {{ log(toggle) }} 7 | 8 |
7 |
Nested level {{ level }}
4 |Nested level {{ level }}
4 |{{ props }}5 |
{{ moreNesting }}8 |
{{ lessNesting }}9 |
Query: {{ q }}
`, 24 | setup() { 25 | const route = useRoute() 26 | const q = computed(() => route.query.q) 27 | 28 | return { q } 29 | }, 30 | }, 31 | { 32 | global: { 33 | plugins: [router], 34 | }, 35 | } 36 | ) 37 | 38 | expect(wrapper.text()).toBe('Query:') 39 | 40 | await router.push('/?q=hi') 41 | expect(wrapper.text()).toBe('Query: hi') 42 | }) 43 | }) 44 | -------------------------------------------------------------------------------- /packages/router/api-extractor.json: -------------------------------------------------------------------------------- 1 | // this the shared base config for all packages. 2 | { 3 | "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", 4 | 5 | "mainEntryPointFilePath": "./dist/src/index.d.ts", 6 | 7 | "apiReport": { 8 | "enabled": true, 9 | "reportFolder": "
77 | path: {{ route.path }}
78 |
79 | query.t: {{ route.query.t }}
80 |
81 | hash: {{ route.hash }}
82 |
Counter: {{ n }}
15 | 16 |Enter Count {{ enterCount }}
30 |Update Count {{ updateCount }}
31 |Leave Count {{ leaveCount }}
32 | 33 | 34 |