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(types):fix Spreading data functional components TSX type error (fix #12778) #12789

Merged
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
14 changes: 7 additions & 7 deletions types/test/vue-test.ts
Expand Up @@ -228,21 +228,21 @@ obj.a++
const ComponentWithStyleInVNodeData = Vue.extend({
render(h) {
const elementWithStyleAsString = h('div', {
style: 'background-color: red;'
style: '--theme-color: black;'
})

const elementWithStyleAsObject = h('div', {
style: { backgroundColor: 'green' }
const elementWithStyleCSSProperties = h('div', {
style: { ['--theme-color' as any]: 'black' }
})

const elementWithStyleAsArrayOfObjects = h('div', {
style: [{ backgroundColor: 'blue' }]
const elementWithStyleAsArrayOfStyleValues = h('div', {
style: [{ ['--theme-color' as any]: 'black' }]
})

return h('div', undefined, [
elementWithStyleAsString,
elementWithStyleAsObject,
elementWithStyleAsArrayOfObjects
elementWithStyleCSSProperties,
elementWithStyleAsArrayOfStyleValues
])
}
})
Expand Down
3 changes: 2 additions & 1 deletion types/vnode.d.ts
@@ -1,3 +1,4 @@
import { StyleValue } from './jsx'
import { Vue } from './vue'
import { DirectiveFunction, DirectiveOptions } from './options'

Expand Down Expand Up @@ -75,7 +76,7 @@ export interface VNodeData {
staticClass?: string
class?: any
staticStyle?: { [key: string]: any }
style?: string | object[] | object
style?: StyleValue
props?: { [key: string]: any }
attrs?: { [key: string]: any }
domProps?: { [key: string]: any }
Expand Down