Skip to content

Commit 218bc52

Browse files
committed
chore: update the layout component routing of the site
1 parent d414d0a commit 218bc52

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

site/plugin-tdoc/component.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ export default defineComponent({
6363
},
6464
name() {
6565
const { path } = this.$route;
66-
return path.slice(path.lastIndexOf('/') + 1);
66+
const name = path.slice(path.lastIndexOf('/') + 1);
67+
68+
return name === 'layout' ? 'col' : name;
6769
},
6870
liveUrl() {
6971
return `//tdesign.tencent.com/miniprogram-live/m2w/program/miniprogram/#!pages/${this.name}/${this.name}.html`;
7072
},
7173
qrcode() {
72-
const { path } = this.$route;
73-
const name = path.slice(path.lastIndexOf('/') + 1);
7474
// new URL(): https://cn.vitejs.dev/guide/assets.html#new-url-url-import-meta-url
75-
return new URL(`../public/assets/qrcode/${name}.png`, import.meta.url).href;
75+
return new URL(`../public/assets/qrcode/${this.name}.png`, import.meta.url).href;
7676
},
7777
},
7878

site/site.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const docs = [
121121
titleEn: 'Layout',
122122
name: 'layout',
123123
meta: { docType: 'base' },
124-
path: '/miniprogram/components/col',
124+
path: '/miniprogram/components/layout',
125125
component: () => import('@/col/README.md'),
126126
},
127127
{

0 commit comments

Comments
 (0)