refactor: use shared util, remove unused regex
This commit is contained in:
parent
149d82d618
commit
aac7805b3a
@ -5,16 +5,11 @@ import {
|
|||||||
} from './component'
|
} from './component'
|
||||||
import { VNodeFlags, ChildrenFlags } from './flags'
|
import { VNodeFlags, ChildrenFlags } from './flags'
|
||||||
import { createComponentClassFromOptions } from './componentUtils'
|
import { createComponentClassFromOptions } from './componentUtils'
|
||||||
import {
|
import { EMPTY_OBJ, isObject, isArray, isFunction, isString } from '@vue/shared'
|
||||||
handlersRE,
|
|
||||||
EMPTY_OBJ,
|
|
||||||
isObject,
|
|
||||||
isArray,
|
|
||||||
isFunction,
|
|
||||||
isString
|
|
||||||
} from '@vue/shared'
|
|
||||||
import { RawChildrenType, RawSlots } from './h'
|
import { RawChildrenType, RawSlots } from './h'
|
||||||
|
|
||||||
|
const handlersRE = /^on|^vnode/
|
||||||
|
|
||||||
// Vue core is platform agnostic, so we are not using Element for "DOM" nodes.
|
// Vue core is platform agnostic, so we are not using Element for "DOM" nodes.
|
||||||
export interface RenderNode {
|
export interface RenderNode {
|
||||||
vnode?: VNode | null
|
vnode?: VNode | null
|
||||||
|
@ -4,8 +4,7 @@ import { patchStyle } from './modules/style'
|
|||||||
import { patchAttr } from './modules/attrs'
|
import { patchAttr } from './modules/attrs'
|
||||||
import { patchDOMProp } from './modules/props'
|
import { patchDOMProp } from './modules/props'
|
||||||
import { patchEvent } from './modules/events'
|
import { patchEvent } from './modules/events'
|
||||||
|
import { onRE } from '@vue/shared'
|
||||||
export const onRE = /^on/
|
|
||||||
|
|
||||||
// value, checked, selected & muted
|
// value, checked, selected & muted
|
||||||
// plus anything with upperCase letter in it are always patched as properties
|
// plus anything with upperCase letter in it are always patched as properties
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { VNode } from '@vue/core'
|
import { VNode } from '@vue/core'
|
||||||
import { handleDelegatedEvent } from './modules/events'
|
import { handleDelegatedEvent } from './modules/events'
|
||||||
import { onRE } from './patchData'
|
import { onRE } from '@vue/shared'
|
||||||
|
|
||||||
export function teardownVNode(vnode: VNode) {
|
export function teardownVNode(vnode: VNode) {
|
||||||
const { el, data } = vnode
|
const { el, data } = vnode
|
||||||
|
@ -3,8 +3,6 @@ export const EMPTY_OBJ: { readonly [key: string]: any } = Object.freeze({})
|
|||||||
export const NOOP = () => {}
|
export const NOOP = () => {}
|
||||||
|
|
||||||
export const onRE = /^on/
|
export const onRE = /^on/
|
||||||
export const vnodeHookRE = /^vnode/
|
|
||||||
export const handlersRE = /^on|^vnode/
|
|
||||||
export const reservedPropRE = /^(?:key|ref|slots)$|^vnode/
|
export const reservedPropRE = /^(?:key|ref|slots)$|^vnode/
|
||||||
|
|
||||||
export const isArray = Array.isArray
|
export const isArray = Array.isArray
|
||||||
|
Loading…
Reference in New Issue
Block a user