Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove explicit class prop #608

Merged
merged 1 commit into from
Jun 10, 2021
Merged

Remove explicit class prop #608

merged 1 commit into from
Jun 10, 2021

Conversation

rynz
Copy link
Contributor

@rynz rynz commented Jun 10, 2021

<Switch
  v-model="enable"
  :class="[
    ...classButton,
    'relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500',
  ]"
>
  ...
node_modules/@headlessui/vue/dist/components/switch/switch.d.ts:45:5
  45     class?: string | Function | undefined;
         ~~~~~
  The expected type comes from property 'class' which is declared here on type 'Partial<{ as: string; modelValue: boolean; }> & Omit<Readonly<{ as: string; modelValue: boolean; } & { class?: string | Function | undefined; className?: string | Function | undefined; }> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "as" | "modelValue"> & Omit<...> & Record<...>'

Fixes this kind of error when using tools such as vue-tsc (https://github.com/vitejs/vite/blob/main/packages/create-app/template-vue-ts/package.json#L6). Vue3 automatically handles :class and class properties implicitly with it's own type checking.

@RobinMalfait to be included with #607 version bump.

@vercel
Copy link

vercel bot commented Jun 10, 2021

@rynz is attempting to deploy a commit to the Tailwind Labs Team on Vercel.

A member of the Team first needs to authorize it.

@rynz rynz changed the base branch from main to develop June 10, 2021 01:55
@RobinMalfait
Copy link
Member

Hey! Thank you for your PR!
Much appreciated! 🙏

Perfect! I was thinking of doing this but then just forgot 🤦

@RobinMalfait RobinMalfait merged commit de6fbd4 into tailwindlabs:develop Jun 10, 2021
@rynz rynz deleted the remove-explicit-class-prop branch June 10, 2021 09:26
@rynz
Copy link
Contributor Author

rynz commented Jun 10, 2021

No worries, when do you think you will version bump?

@RobinMalfait
Copy link
Member

@rynz right about now:

You can already try it using npm install @headlessui/vue@dev or yarn add @headlessui/vue@dev.

@rynz
Copy link
Contributor Author

rynz commented Jun 10, 2021

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants