Skip to content

Commit 6f52012

Browse files
committed
feat: AsyncMarkdownContentLoaded event
1 parent 9c947b2 commit 6f52012

File tree

1 file changed

+10
-1
lines changed
  • packages/@vuepress/markdown-loader

1 file changed

+10
-1
lines changed

packages/@vuepress/markdown-loader/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,16 @@ module.exports = function (src) {
102102
`<template>\n` +
103103
`<ContentSlotsDistributor :slot-key="slotKey">${html}</ContentSlotsDistributor>\n` +
104104
`</template>\n` +
105-
`<script>export default { props: ['slot-key'] }</script>` +
105+
`<script>
106+
export default {
107+
props: ['slot-key'],
108+
mounted() {
109+
this.$nextTick(function () {
110+
this.$vuepress.$emit('AsyncMarkdownContentLoaded', this.slotKey)
111+
})
112+
}
113+
}
114+
</script>` +
106115
(hoistedTags || []).join('\n') +
107116
`\n${dataBlockString}\n`
108117
)

0 commit comments

Comments
 (0)