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

fix #9727 #9728

Merged
merged 2 commits into from Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion flow/vnode.js
Expand Up @@ -42,7 +42,7 @@ declare interface VNodeData {
staticClass?: string;
class?: any;
staticStyle?: { [key: string]: any };
style?: Array<Object> | Object;
style?: string | Array<Object> | Object;
normalizedStyle?: Object;
props?: { [key: string]: any };
attrs?: { [key: string]: string };
Expand Down
25 changes: 25 additions & 0 deletions types/test/vue-test.ts
Expand Up @@ -213,3 +213,28 @@ class Decorated extends Vue {

const obj = Vue.observable({ a: 1 })
obj.a++

// VNodeData style tests.
const ComponentWithStyleInVNodeData = Vue.extend({
render (h) {
const elementWithStyleAsString = h('div', {
style: 'background-color: red;'
});

const elementWithStyleAsObject = h('div', {
style: { backgroundColor: 'green' }
});

const elementWithStyleAsArrayOfObjects = h('div', {
style: [
{ backgroundColor: 'blue' }
]
});

return h('div', undefined, [
elementWithStyleAsString,
elementWithStyleAsObject,
elementWithStyleAsArrayOfObjects
]);
}
});
2 changes: 1 addition & 1 deletion types/vnode.d.ts
Expand Up @@ -48,7 +48,7 @@ export interface VNodeData {
staticClass?: string;
class?: any;
staticStyle?: { [key: string]: any };
style?: object[] | object;
style?: string | object[] | object;
props?: { [key: string]: any };
attrs?: { [key: string]: any };
domProps?: { [key: string]: any };
Expand Down