Skip to content

Commit

Permalink
chore: attempt to remove vue-class-component
Browse files Browse the repository at this point in the history
The vue-class-component docs are confusing at this time. This was
an attempt to remove this dependency. It was not successful.
  • Loading branch information
luqven committed Apr 20, 2021
1 parent ebe0a5e commit 1710de7
Showing 1 changed file with 16 additions and 26 deletions.
42 changes: 16 additions & 26 deletions src/plugins/vue-imgix/ix-img.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
import { defineComponent, h } from 'vue';
import { ensureVueImgixClientSingleton, IVueImgixClient } from './vue-imgix';
import { Vue, prop } from 'vue-class-component';

const Props = {
src: prop({ type: String, required: true }),
fixed: prop({type: Boolean}),
imgixParams: prop({type: Object}),
width: prop({ [String, Number]}),
height: prop({ [String, Number]}),
attributeConfig: prop({type: Object}),
disableVariableQuality: prop({type: Boolean}),
};

// const IxImgProps = defineComponent({
// props: {
// src: {
// type: String,
// required: true,
// },
// fixed: Boolean,
// imgixParams: Object,
// width: [String, Number],
// height: [String, Number],
// attributeConfig: Object,
// disableVariableQuality: Boolean,
// },
// });
const IxImgProps = defineComponent({
props: {
src: {
type: String,
required: true,
},
fixed: Boolean,
imgixParams: Object,
width: [String, Number],
height: [String, Number],
attributeConfig: Object,
disableVariableQuality: Boolean,
},
});

const defaultAttributeMap = {
src: 'src',
srcset: 'srcset',
};

export class IxImg extends Vue.with(Props) {
export class IxImg extends IxImgProps {
// Using !: here because we ensure it is set in created()
private vueImgixSingleton!: IVueImgixClient;

Expand Down

0 comments on commit 1710de7

Please sign in to comment.