Skip to content

Commit

Permalink
fix: picture mode by changing JSX usage in IxPicture and IxSource
Browse files Browse the repository at this point in the history
  • Loading branch information
frederickfogerty committed Jul 22, 2020
1 parent cefa6a1 commit 97d1255
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/plugins/vue-imgix/ix-picture.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
ensureVueImgixClientSingleton,
IVueImgixClient,
IVueImgixClient
} from '@/plugins/vue-imgix/vue-imgix';
import Vue from 'vue';
import Vue, { CreateElement } from 'vue';
import Component from 'vue-class-component';

const IxPictureProps = Vue.extend({
Expand All @@ -18,7 +18,7 @@ export class IxPicture extends IxPictureProps {
this.vueImgixSingleton = ensureVueImgixClientSingleton();
}

render() {
return <picture>{this.$slots.default}</picture>;
render(createElement: CreateElement) {
return createElement('picture', this.$slots.default);
}
}
8 changes: 4 additions & 4 deletions src/plugins/vue-imgix/ix-source.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
ensureVueImgixClientSingleton,
IVueImgixClient,
IVueImgixClient
} from '@/plugins/vue-imgix/vue-imgix';
import Vue from 'vue';
import Vue, { CreateElement } from 'vue';
import Component from 'vue-class-component';

const IxSourceProps = Vue.extend({
Expand Down Expand Up @@ -30,7 +30,7 @@ export class IxSource extends IxSourceProps {
this.vueImgixSingleton = ensureVueImgixClientSingleton();
}

render() {
render(createElement: CreateElement) {
const imgixParamsFromAttributes = {};

const { srcset } = this.vueImgixSingleton.buildUrlObject(this.src, {
Expand All @@ -47,6 +47,6 @@ export class IxSource extends IxSourceProps {
[attributeConfig.srcset]: srcset,
};

return <source attrs={childAttrs} />;
return createElement('source', { attrs: childAttrs });
}
}

0 comments on commit 97d1255

Please sign in to comment.