Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
TS not recognizing typing in tween (Vue3 + Storybook)

I'm trying to type the implementation of the standard Button component from Storybook, it was supposed to be typed, but my TS is giving an error in the interpolation within the setup, as in the image below...

enter image description here

I don't know if it's a syntax error or a tsconfig error, here's the snippet of the code in question:

export default defineComponent({
  name: 'my-button',
  components: {
    VBtn
  },
  props: {
    label: {
      type: Boolean,
      required: true,
    },
    variation: String,
    size: {
      type: String,
      validator: function (value: string) {
        return ['small', 'medium', 'large'].indexOf(value) !== -1;
      },
    },
    backgroundColor: {
      type: String,
    },
  },

  emits: ['click'],

  setup(props, { emit }): typeSetup {
    props = reactive(props);
    return {
      classes: computed(() => ({
        'storybook-button': true,
        [`storybook-button--${props.variation}`]: true,
        [`storybook-button--${props.size || 'medium'}`]: true,
      })),
      style: computed(() => ({
        backgroundColor: props.backgroundColor,
      })),
      onClick() {
        emit('click');
      },
    }
  },
});

Error:

Property 'variation' does not exist on type
'Readonly<LooseRequired<Readonly<ExtractPropTypes<Readonly<ComponentPropsOptions<Data>>>>>
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!