mirror of https://github.com/vuejs/core.git
23 lines
544 B
TypeScript
23 lines
544 B
TypeScript
|
import { isOn } from '@vue/shared'
|
||
|
import { ComponentInternalInstance } from '../component'
|
||
|
import { DeprecationTypes, isCompatEnabled } from './compatConfig'
|
||
|
|
||
|
export function shouldSkipAttr(
|
||
|
key: string,
|
||
|
instance: ComponentInternalInstance
|
||
|
): boolean {
|
||
|
if (
|
||
|
(key === 'class' || key === 'style') &&
|
||
|
isCompatEnabled(DeprecationTypes.INSTANCE_ATTRS_CLASS_STYLE, instance)
|
||
|
) {
|
||
|
return true
|
||
|
}
|
||
|
if (
|
||
|
isOn(key) &&
|
||
|
isCompatEnabled(DeprecationTypes.INSTANCE_LISTENERS, instance)
|
||
|
) {
|
||
|
return true
|
||
|
}
|
||
|
return false
|
||
|
}
|