-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Description
What problem does this feature solve?
The current render function h
props param is slightly different than vue2, described in https://v3.vuejs.org/guide/migration/render-function-api.html#vnode-props-format.
Though, the current type on h
's prop param is Data & VNodeProps
. Neither of them has the similar type definition like VNodeData
in vue2, declaring the class
, style
, staticClass
, etc. (only the Record<string, unknown> currently)
Adding some basic typing on it can helps user to migrate faster and avoid passing param like vue2.
What does the proposed API look like?
The API props param type changed, at least including some basic definition like
{
staticClass?: string;
class?: string | string[];
staticStyle?: { [key: string]: any };
style?: string | object[] | object;
onClick?: (e: MouseEvent) => void
... rest of definitions
}
Activity
add staticClass and style to migration guide
posva commentedon Sep 29, 2020
I don't think there is a way, only using types, that allows both, to hint the user about removed attributes and, to allow users to use their own props on the new flattened structure. I think it's worth updating the docs so I opened a PR there
add staticClass and style to migration guide (#566)
add staticClass and style to migration guide (vuejs#566)
add staticClass and style to migration guide (#566)