Skip to content

Commit

Permalink
chore(demo): symbol prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Oct 3, 2022
1 parent 257d13b commit 680ad3f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/shell-dev-vue2/src/NativeTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ for (let i = 0; i < 1000000; i++) {
veryLongText += `line${i}\n`
}
const unassignedPropSymbol = Symbol('unassigned')
export default {
components: {
TestComponent: {
Expand All @@ -100,6 +102,17 @@ export default {
},
},
props: {
multiTypeProp: {
type: [Date, Boolean],
default: false,
},
symbolProp: {
default: unassignedPropSymbol,
},
},
data () {
return {
localDate: new Date(),
Expand Down
2 changes: 1 addition & 1 deletion packages/shell-dev-vue2/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const app = new Vue({
h(Target, { props: { msg: 'hi', ins: new MyClass() } }),
h(Other),
h(Events, { key: 'foo' }),
h(NativeTypes, { key: new Date() }),
h(NativeTypes, { key: new Date(), ref: 'nativeTypes' }),
h(Router, { key: [] }),
h(TransitionExample),
h(VuexObject),
Expand Down
2 changes: 1 addition & 1 deletion packages/shell-dev-vue3/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default {

<Child question="Life" />
<NestedMore />
<NativeTypes />
<NativeTypes ref="nativeTypes" />
<EventEmit />
<EventNesting />
<AsyncComponent />
Expand Down
6 changes: 6 additions & 0 deletions packages/shell-dev-vue3/src/NativeTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ for (let i = 0; i < 1000000; i++) {
veryLongText += `line${i}\n`
}
const unassignedPropSymbol = Symbol('unassigned')
export default {
components: {
TestComponent: {
Expand All @@ -83,6 +85,10 @@ export default {
type: [Date, Boolean],
default: false,
},
symbolProp: {
default: unassignedPropSymbol,
},
},
data () {
Expand Down

0 comments on commit 680ad3f

Please sign in to comment.