chore(reactivity): use warn (#5548)
This commit is contained in:
parent
2c09969b13
commit
711c826c68
@ -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
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user