Skip to content

Commit e65cb42

Browse files
committed
fix: modify the story frame path base on the base path
1 parent 718c889 commit e65cb42

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

docs/.vitepress/config/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const en = defineConfig({
1515
{ text: 'Design', link: '/design/basic', activeMatch: '/design/' },
1616
{
1717
text: 'Style',
18-
link: '/style/start/install',
18+
link: '/style/start/quick-start',
1919
activeMatch: '/style/',
2020
},
2121
],

docs/.vitepress/config/shared.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { whyframe } from '@whyframe/core';
33
import { whyframeVue } from '@whyframe/vue';
44

55
const isProd = process.env.NODE_ENV === 'production';
6+
const base = !isProd ? '/' : '/responsive-toolkit/';
67

78
export const shared = defineConfig({
8-
base: !isProd ? '/' : '/responsive-toolkit/',
9+
base,
910

1011
title: 'Responsive Toolkit',
1112
description:
@@ -31,7 +32,7 @@ export const shared = defineConfig({
3132
/**
3233
* vitepress doesn't support whyframe default html, so we need to use a custom one
3334
*/
34-
defaultSrc: '/frames/default.html',
35+
defaultSrc: `${base}frames/default.html`,
3536
components: [{ name: 'Story', showSource: true }],
3637
}),
3738
whyframeVue({

docs/.vitepress/config/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const zh = defineConfig({
1111
{ text: 'Design', link: '/zh/design/basic', activeMatch: '/zh/design/' },
1212
{
1313
text: 'Style',
14-
link: '/zh/style/setup',
14+
link: '/zh/style/quick-start',
1515
activeMatch: '/zh/style',
1616
},
1717
],

docs/.vitepress/theme/components/Story/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { codeToHtml } from 'shiki';
3-
import { useData } from 'vitepress';
3+
import { useData, withBase } from 'vitepress';
44
import { getWhyframeSource } from '@whyframe/core/utils';
55
import { computed, ref, useTemplateRef, watch } from 'vue';
66
import VueDraggableResizable from 'vue-draggable-resizable';
@@ -37,7 +37,7 @@ const props = defineProps({
3737
},
3838
src: {
3939
type: String,
40-
default: '/frames/default.html',
40+
default: withBase('/frames/default.html'),
4141
},
4242
4343
defaultShowCode: {
@@ -131,7 +131,6 @@ watch(isVisible, (val) => {
131131
data-why
132132
class="story-iframe"
133133
:title="title"
134-
:src="src"
135134
>
136135
<slot />
137136
</iframe>

0 commit comments

Comments
 (0)