From f20f7d0033b02d0ee6d7e273846e94aba98ddfb1 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Wed, 8 May 2024 17:11:44 +0800
Subject: [PATCH] =?UTF-8?q?feat(props):=20=E8=A1=A5=E5=85=85=20withDefault?=
=?UTF-8?q?s=20=E7=A4=BA=E4=BE=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../props/props-composition.uvue | 2 ++
.../props/props-options.uvue | 5 +++-
.../props/props-with-defaults.uvue | 25 +++++++++++++++++++
3 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 pages/component-instance/props/props-with-defaults.uvue
diff --git a/pages/component-instance/props/props-composition.uvue b/pages/component-instance/props/props-composition.uvue
index e3db412..5b8c276 100644
--- a/pages/component-instance/props/props-composition.uvue
+++ b/pages/component-instance/props/props-composition.uvue
@@ -3,6 +3,7 @@
+
@@ -10,6 +11,7 @@
import ArrayLiteral from './array-literal-composition.uvue'
import ObjectType from "./object-type-composition.uvue";
import SameNamePropDefaultValue from "./same-name-prop-default-value-composition.uvue";
+import PropsWithDefaults from "./props-with-defaults.uvue";
const str = 'str'
const num = 10
diff --git a/pages/component-instance/props/props-options.uvue b/pages/component-instance/props/props-options.uvue
index 7cd06b3..a559b76 100644
--- a/pages/component-instance/props/props-options.uvue
+++ b/pages/component-instance/props/props-options.uvue
@@ -3,6 +3,7 @@
+
@@ -10,12 +11,14 @@
import ArrayLiteral from './array-literal-options.uvue'
import ObjectType from "./object-type-options.uvue";
import SameNamePropDefaultValue from "./same-name-prop-default-value-options.uvue";
+import PropsWithDefaults from "./props-with-defaults.uvue";
export default {
components: {
ArrayLiteral,
ObjectType,
- SameNamePropDefaultValue
+ SameNamePropDefaultValue,
+ PropsWithDefaults
},
data() {
return {
diff --git a/pages/component-instance/props/props-with-defaults.uvue b/pages/component-instance/props/props-with-defaults.uvue
new file mode 100644
index 0000000..c560943
--- /dev/null
+++ b/pages/component-instance/props/props-with-defaults.uvue
@@ -0,0 +1,25 @@
+
+
+ withDefaults
+
+ msg
+ {{ props.msg }}
+
+
+ labels
+ {{ JSON.stringify(props.labels) }}
+
+
+
+
+
--
GitLab