Describe the bug
when i import the .md file in the component of children section like below, it doesnot work.
otherwise in the parent component it works well.
pls help me with this problem and how to do to make it work in the children section
// index.js
import { createRouter, createWebHistory } from 'vue-router'
import MyView from '../views/MyView.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: MyView,
},
{
path: '/one',
component: () => import('../pages/one.md'),
children: [
{
path: 'sub-a',
component: () => import("../pages/one-sub-a.md")
},
{
path: 'sub-b',
component: () => import("../pages/one-sub-b.md")
}
]
},
{
path: '/two',
component: () => import('../pages/two.md')
},
],
})
export default router
// App.vue
<template>
<nav>
<RouterLink to="/">home</RouterLink>|
<RouterLink to="/one">one</RouterLink>|
<RouterLink to="/two">two</RouterLink>|
<RouterLink to="/one/sub-a">one-sub-a</RouterLink>|
<RouterLink to="/one/sub-b">one-sub-b</RouterLink>
</nav>
<br />
<div>
<RouterView />
</div>
</template>
// vite.config.js
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
import Markdown from 'unplugin-vue-markdown/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue({
include: [/\.vue$/, /\.md$/], // <-- allows Vue to compile Markdown files
}),
vueDevTools(),
Markdown()
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
})
Reproduction
https://github.com/hualayn/unplugin-vue-markdown-test
System Info
System:
OS: Windows 11 10.0.26100
CPU: (4) x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz
Memory: 6.23 GB / 15.88 GB
Binaries:
Node: 22.11.0 - ~\AppData\Local\fnm_multishells\7424_1735279886876\node.EXE
npm: 11.0.0 - ~\AppData\Local\fnm_multishells\7424_1735279886876\npm.CMD
Browsers:
Edge: Chromium (129.0.2792.79)
Used Package Manager
npm
Validations
Describe the bug
when i import the .md file in the component of children section like below, it doesnot work.
otherwise in the parent component it works well.
pls help me with this problem and how to do to make it work in the children section
Reproduction
https://github.com/hualayn/unplugin-vue-markdown-test
System Info
System: OS: Windows 11 10.0.26100 CPU: (4) x64 Intel(R) Core(TM) i3-7100 CPU @ 3.90GHz Memory: 6.23 GB / 15.88 GB Binaries: Node: 22.11.0 - ~\AppData\Local\fnm_multishells\7424_1735279886876\node.EXE npm: 11.0.0 - ~\AppData\Local\fnm_multishells\7424_1735279886876\npm.CMD Browsers: Edge: Chromium (129.0.2792.79)Used Package Manager
npm
Validations