[Vuejs]-How to fix a not existing property on a type of a component in a VueJs3 and typescript application?

-1👍

This is the fix:

interface ImagerProps {
  source: string
}

export default {
  name: 'Imager',
  props: {
    source: {
      type: String,
      required: true,
    },
  },
  computed: {
    style(props: ImagerProps): string {
      return `background-image: url('${props.source}')`
    },
  },
}

Leave a comment