wip: add types to refactored runtime-core
This commit is contained in:
@@ -1,18 +1,12 @@
|
||||
import { VNode, ChildrenFlags } from '@vue/runtime-core'
|
||||
|
||||
export function patchDOMProp(
|
||||
el: any,
|
||||
key: string,
|
||||
value: any,
|
||||
prevVNode: VNode,
|
||||
prevChildren: any,
|
||||
unmountChildren: any
|
||||
) {
|
||||
if (key === 'innerHTML' || key === 'textContent') {
|
||||
if (prevVNode && prevVNode.children) {
|
||||
unmountChildren(prevVNode.children, prevVNode.childFlags)
|
||||
prevVNode.children = null
|
||||
prevVNode.childFlags = ChildrenFlags.NO_CHILDREN
|
||||
}
|
||||
if ((key === 'innerHTML' || key === 'textContent') && prevChildren != null) {
|
||||
unmountChildren(prevChildren)
|
||||
}
|
||||
el[key] = value
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isString } from '@vue/shared'
|
||||
|
||||
export function patchStyle(el: any, prev: any, next: any, data: any) {
|
||||
export function patchStyle(el: any, prev: any, next: any) {
|
||||
const { style } = el
|
||||
if (!next) {
|
||||
el.removeAttribute('style')
|
||||
|
||||
Reference in New Issue
Block a user