From b02c587d8ad482154b5d52cbadc25da309a2fc34 Mon Sep 17 00:00:00 2001 From: it-evan Date: Thu, 5 Jun 2025 14:43:35 +0800 Subject: [PATCH] docs(computed): correct parameter positions in the computed example --- src/guide/essentials/computed.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/guide/essentials/computed.md b/src/guide/essentials/computed.md index a8f0532abf..47a46da76c 100644 --- a/src/guide/essentials/computed.md +++ b/src/guide/essentials/computed.md @@ -263,8 +263,15 @@ Now when you run `fullName.value = 'John Doe'`, the setter will be invoked and ` - Only supported in 3.4+ +

+In case you need it, you can get the previous value returned by the computed property accessing +the second argument of the getter: +

+ +

In case you need it, you can get the previous value returned by the computed property accessing the first argument of the getter: +

@@ -326,7 +333,7 @@ export default { }, computed: { alwaysSmall: { - get(previous) { + get(_, previous) { if (this.count <= 3) { return this.count }