]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore(reactivity): improve readonly/reactive warning message (#9095)
authorchenfan <83797583+chenfan0@users.noreply.github.com>
Mon, 27 May 2024 09:31:11 +0000 (17:31 +0800)
committerGitHub <noreply@github.com>
Mon, 27 May 2024 09:31:11 +0000 (17:31 +0800)
packages/reactivity/src/reactive.ts

index f6fcbbdb98f7aa9b4d68679a6e03cab89774df1a..a3e7ecc7b56e651b1ea28e6287bbbd4a617573a8 100644 (file)
@@ -248,7 +248,11 @@ function createReactiveObject(
 ) {
   if (!isObject(target)) {
     if (__DEV__) {
-      warn(`value cannot be made reactive: ${String(target)}`)
+      warn(
+        `value cannot be made ${isReadonly ? 'readonly' : 'reactive'}: ${String(
+          target,
+        )}`,
+      )
     }
     return target
   }