Skip to content
Discussion options

You must be logged in to vote

/.vitepress/theme/components 里,建一个Waline.vue,内容抄官方文档const serverURL 填从外部可调用的Waline服务端网址,然后/.vitepress/theme/index.ts 里:
h函数法:

import Waline from './components/Waline.vue'

// ...

export default {
    extends: DefaultTheme,
    Layout: () => {
        const LayoutWrapper = {
            setup() {
                return () => h(DefaultTheme.Layout, null, {
                    // ...
                    'doc-after': () => h(Waline),
                    // ...
                })
            }
        }
        return h(LayoutWrapper)
    },
    enhanceApp({ app, router }) {
        app.component('Waline', Waline)
        }

    },

基础应该就行了


In /.vitepress/theme/components, create a Waline.vue,…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lizheming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion Question or dicussion
3 participants
Converted from issue

This discussion was converted from issue #2749 on October 09, 2024 11:03.