Skip to content

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

@adamwathan

Description

@adamwathan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions