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

Array of classes in cloneVNode are joined with ',' instead of mimicking class prop #1964

Closed
adamwathan opened this issue Aug 26, 2020 · 0 comments · Fixed by #1967
Closed

Comments

@adamwathan
Copy link

Version

3.0.0-rc.8

Reproduction link

https://codesandbox.io/s/weathered-bush-fd9mf?file=/src/LabeledIcon.vue

Steps to reproduce

Creating a render function component that looks something like this:

import { h, cloneVNode } from "vue";

export default {
  setup(props, { slots }) {
    const [span] = slots.default();

    return () => cloneVNode(span, { class: ["foo", "bar"] });
  }
};

...will ultimately render something like instead of .

What is expected?

Should treat the class property like the class prop, and support array syntax, object syntax, etc.

What is actually happening?

Classes appear to just be joined with ",", looks like Array.toString() sort of behavior.

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

Successfully merging a pull request may close this issue.

1 participant