Skip to content

Commit 20d612c

Browse files
committed
refactor: simplify the implementation of makrdown slots
1 parent 1cba9bc commit 20d612c

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

packages/@vuepress/core/lib/app/app.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import('@temp/style.styl')
1313

1414
// built-in components
1515
import Content from './components/Content'
16-
import ContentSlotsDistributor from './components/ContentSlotsDistributor'
1716
import OutboundLink from './components/OutboundLink.vue'
1817
import ClientOnly from './components/ClientOnly'
1918

@@ -36,7 +35,6 @@ Vue.use(Router)
3635
Vue.mixin(dataMixin(I18n, siteData))
3736
// component for rendering markdown content and setting title etc.
3837
Vue.component('Content', Content)
39-
Vue.component('ContentSlotsDistributor', ContentSlotsDistributor)
4038
Vue.component('OutboundLink', OutboundLink)
4139
// component for client-only content
4240
Vue.component('ClientOnly', ClientOnly)

packages/@vuepress/core/lib/app/components/Content.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ export default {
1616
render (h, { parent, props, data }) {
1717
const pageKey = props.pageKey || parent.$page.key
1818
Vue.component(pageKey, components[pageKey])
19+
1920
return h(pageKey, {
2021
class: [props.custom ? 'custom' : '', data.class, data.staticClass],
2122
style: data.style,
22-
props: {
23-
target: props.slot || 'default'
24-
}
23+
slot: props.slot || 'default'
2524
})
2625
}
2726
}

packages/@vuepress/core/lib/app/components/ContentSlotsDistributor.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/@vuepress/core/lib/webpack/markdownLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module.exports = function (src) {
8383

8484
const res = (
8585
`<template>\n` +
86-
`<ContentSlotsDistributor :target="target">${html}</ContentSlotsDistributor>\n` +
86+
`<div class="content">${html}</div>\n` +
8787
`</template>\n` +
8888
`<script>export default { props: ['target'] }</script>` +
8989
(hoistedTags || []).join('\n')

0 commit comments

Comments
 (0)