parent
acb2a4d285
commit
2bdee50a59
@ -342,7 +342,7 @@ describe('vnode', () => {
|
||||
|
||||
describe('mergeProps', () => {
|
||||
test('class', () => {
|
||||
let props1: Data = { class: 'c' }
|
||||
let props1: Data = { class: { c: true } }
|
||||
let props2: Data = { class: ['cc'] }
|
||||
let props3: Data = { class: [{ ccc: true }] }
|
||||
let props4: Data = { class: { cccc: true } }
|
||||
@ -353,10 +353,12 @@ describe('vnode', () => {
|
||||
|
||||
test('style', () => {
|
||||
let props1: Data = {
|
||||
style: {
|
||||
color: 'red',
|
||||
fontSize: 10
|
||||
}
|
||||
style: [
|
||||
{
|
||||
color: 'red',
|
||||
fontSize: 10
|
||||
}
|
||||
]
|
||||
}
|
||||
let props2: Data = {
|
||||
style: [
|
||||
|
@ -778,8 +778,8 @@ export function normalizeChildren(vnode: VNode, children: unknown) {
|
||||
}
|
||||
|
||||
export function mergeProps(...args: (Data & VNodeProps)[]) {
|
||||
const ret = extend({}, args[0])
|
||||
for (let i = 1; i < args.length; i++) {
|
||||
const ret: Data = {}
|
||||
for (let i = 0; i < args.length; i++) {
|
||||
const toMerge = args[i]
|
||||
for (const key in toMerge) {
|
||||
if (key === 'class') {
|
||||
|
Loading…
Reference in New Issue
Block a user