More Rich Type on Data & VNodeProps for Render Function
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
}