chore: use isArray to keep the code consistency
This commit is contained in:
parent
870f2a7ba3
commit
7db8c9c19a
@ -1,5 +1,6 @@
|
||||
import { ComponentInternalInstance, Slots } from 'vue'
|
||||
import { Props, PushFn, renderVNodeChildren, SSRBufferItem } from '../render'
|
||||
import { isArray } from '@vue/shared'
|
||||
|
||||
export type SSRSlots = Record<string, SSRSlot>
|
||||
export type SSRSlot = (
|
||||
@ -32,7 +33,7 @@ export function ssrRenderSlot(
|
||||
parentComponent,
|
||||
slotScopeId ? ' ' + slotScopeId : ''
|
||||
)
|
||||
if (Array.isArray(ret)) {
|
||||
if (isArray(ret)) {
|
||||
// normal slot
|
||||
renderVNodeChildren(push, ret, parentComponent, slotScopeId)
|
||||
} else {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { looseEqual, looseIndexOf } from '@vue/shared'
|
||||
import { looseEqual, looseIndexOf, isArray } from '@vue/shared'
|
||||
import { ssrRenderAttr } from './ssrRenderAttrs'
|
||||
|
||||
export const ssrLooseEqual = looseEqual as (a: unknown, b: unknown) => boolean
|
||||
@ -17,7 +17,7 @@ export function ssrRenderDynamicModel(
|
||||
case 'radio':
|
||||
return looseEqual(model, value) ? ' checked' : ''
|
||||
case 'checkbox':
|
||||
return (Array.isArray(model)
|
||||
return (isArray(model)
|
||||
? ssrLooseContain(model, value)
|
||||
: model)
|
||||
? ' checked'
|
||||
@ -38,7 +38,7 @@ export function ssrGetDynamicModelProps(
|
||||
case 'radio':
|
||||
return looseEqual(model, value) ? { checked: true } : null
|
||||
case 'checkbox':
|
||||
return (Array.isArray(model)
|
||||
return (isArray(model)
|
||||
? ssrLooseContain(model, value)
|
||||
: model)
|
||||
? { checked: true }
|
||||
|
Loading…
Reference in New Issue
Block a user