Skip to content

Commit

Permalink
chore(picture): update slot syntax to vue 3
Browse files Browse the repository at this point in the history
  • Loading branch information
luqven committed Jan 7, 2022
1 parent fe9a14e commit 1cd219c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/vue-imgix/ix-picture.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { ensureVueImgixClientSingleton } from './vue-imgix';
import { defineComponent, h } from 'vue';
import { ensureVueImgixClientSingleton } from './vue-imgix';

const IxPictureProps = defineComponent({
props: {},
});

export const IxPicture = defineComponent({
mixins: [IxPictureProps],
render() {
setup(_, { slots }) {
ensureVueImgixClientSingleton();

return h('picture', this.$slots.default);
const defaultSlots = slots && slots.default && slots.default();
return () => {
return h('picture', defaultSlots);
};
},
});

0 comments on commit 1cd219c

Please sign in to comment.