Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

180
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda