chore(reactivity): use warn (#5548)

This commit is contained in:
Code_xxmyyds 2022-04-13 17:21:38 +08:00 committed by GitHub
parent 2c09969b13
commit 711c826c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,7 @@ import {
makeMap makeMap
} from '@vue/shared' } from '@vue/shared'
import { isRef } from './ref' import { isRef } from './ref'
import { warn } from './warning'
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`) const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`)
@ -218,7 +219,7 @@ export const readonlyHandlers: ProxyHandler<object> = {
get: readonlyGet, get: readonlyGet,
set(target, key) { set(target, key) {
if (__DEV__) { if (__DEV__) {
console.warn( warn(
`Set operation on key "${String(key)}" failed: target is readonly.`, `Set operation on key "${String(key)}" failed: target is readonly.`,
target target
) )
@ -227,7 +228,7 @@ export const readonlyHandlers: ProxyHandler<object> = {
}, },
deleteProperty(target, key) { deleteProperty(target, key) {
if (__DEV__) { if (__DEV__) {
console.warn( warn(
`Delete operation on key "${String(key)}" failed: target is readonly.`, `Delete operation on key "${String(key)}" failed: target is readonly.`,
target target
) )