Skip to content

Commit 680ad3f

Browse files
committed
chore(demo): symbol prop
1 parent 257d13b commit 680ad3f

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

packages/shell-dev-vue2/src/NativeTypes.vue

+13
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ for (let i = 0; i < 1000000; i++) {
8888
veryLongText += `line${i}\n`
8989
}
9090
91+
const unassignedPropSymbol = Symbol('unassigned')
92+
9193
export default {
9294
components: {
9395
TestComponent: {
@@ -100,6 +102,17 @@ export default {
100102
},
101103
},
102104
105+
props: {
106+
multiTypeProp: {
107+
type: [Date, Boolean],
108+
default: false,
109+
},
110+
111+
symbolProp: {
112+
default: unassignedPropSymbol,
113+
},
114+
},
115+
103116
data () {
104117
return {
105118
localDate: new Date(),

packages/shell-dev-vue2/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const app = new Vue({
5050
h(Target, { props: { msg: 'hi', ins: new MyClass() } }),
5151
h(Other),
5252
h(Events, { key: 'foo' }),
53-
h(NativeTypes, { key: new Date() }),
53+
h(NativeTypes, { key: new Date(), ref: 'nativeTypes' }),
5454
h(Router, { key: [] }),
5555
h(TransitionExample),
5656
h(VuexObject),

packages/shell-dev-vue3/src/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default {
115115

116116
<Child question="Life" />
117117
<NestedMore />
118-
<NativeTypes />
118+
<NativeTypes ref="nativeTypes" />
119119
<EventEmit />
120120
<EventNesting />
121121
<AsyncComponent />

packages/shell-dev-vue3/src/NativeTypes.vue

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ for (let i = 0; i < 1000000; i++) {
6666
veryLongText += `line${i}\n`
6767
}
6868
69+
const unassignedPropSymbol = Symbol('unassigned')
70+
6971
export default {
7072
components: {
7173
TestComponent: {
@@ -83,6 +85,10 @@ export default {
8385
type: [Date, Boolean],
8486
default: false,
8587
},
88+
89+
symbolProp: {
90+
default: unassignedPropSymbol,
91+
},
8692
},
8793
8894
data () {

0 commit comments

Comments
 (0)