Skip to content

Commit 031239c

Browse files
committed
fix: vue2 slot render
1 parent 93a2206 commit 031239c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/RoughNotation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, h } from 'vue-demi';
1+
import { defineComponent, h, isVue2 } from 'vue-demi';
22
import { annotate } from 'rough-notation';
33
import { ADD_ANNOTATION, REMOVE_ANNOTATION } from '../constants';
44

@@ -158,7 +158,7 @@ export default (options) =>
158158
},
159159

160160
render() {
161-
const slot = this.$slots.default();
161+
const slot = isVue2 ? this.$slots.default : this.$slots.default();
162162

163163
if (this.tag) {
164164
return h(this.tag, null, slot);

src/components/RoughNotationGroup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, h } from 'vue-demi';
1+
import { defineComponent, h, isVue2 } from 'vue-demi';
22
import { annotationGroup } from 'rough-notation';
33
import mitt from 'mitt';
44
import { ADD_ANNOTATION, REMOVE_ANNOTATION } from '../constants';
@@ -105,7 +105,7 @@ export default defineComponent({
105105
},
106106

107107
render() {
108-
const slot = this.$slots.default();
108+
const slot = isVue2 ? this.$slots.default : this.$slots.default();
109109

110110
if (this.tag) {
111111
return h(this.tag, null, slot);

0 commit comments

Comments
 (0)