Repository navigation
我想在md文件中引用config.js定义的全局变量,应该怎么做? #1622
Replies: 1 comment 2 replies
|
import { defineClientConfig } from 'vuepress/client'
export default defineClientConfig({
enhance({ app }) {
Object.defineProperties(app.config.globalProperties, {
$a: {
get() {
return '123'
},
},
})
}
})In markdown file: ${{ $a }}You will get |
2 replies
Answer selected by
Louis-XIV
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.vuepress/client.js:In markdown file:
${{ $a }}You will get
123in render result.