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