export default {
props: _mergeDefaults(['foo', 'bar'], {
foo: 1,
- bar: () => {}
+ bar: () => ({})
}),
setup(__props) {
export default /*#__PURE__*/_defineComponent({
props: {
foo: { type: Number, required: false, default: 1 },
- bar: { type: Object, required: false, default: () => {} }
+ bar: { type: Object, required: false, default: () => ({}) }
},
setup(__props: any) {
export default /*#__PURE__*/_defineComponent({
props: {
foo: { default: 1 },
- bar: { default: () => {} },
+ bar: { default: () => ({}) },
baz: null,
boola: { type: Boolean },
boolb: { type: [Boolean, Number] },
- func: { type: Function, default: () => () => {} }
+ func: { type: Function, default: () => (() => {}) }
},
setup(__props: any) {
// function
expect(content).toMatch(`props: _mergeDefaults(['foo', 'bar'], {
foo: 1,
- bar: () => {}
+ bar: () => ({})
})`)
assertCode(content)
})
// function
expect(content).toMatch(`props: {
foo: { type: Number, required: false, default: 1 },
- bar: { type: Object, required: false, default: () => {} }
+ bar: { type: Object, required: false, default: () => ({}) }
}`)
assertCode(content)
})
// function
expect(content).toMatch(`props: {
foo: { default: 1 },
- bar: { default: () => {} },
+ bar: { default: () => ({}) },
baz: null,
boola: { type: Boolean },
boolb: { type: [Boolean, Number] },
- func: { type: Function, default: () => () => {} }
+ func: { type: Function, default: () => (() => {}) }
}`)
assertCode(content)
})
destructured.default.end!
)
const isLiteral = destructured.default.type.endsWith('Literal')
- return isLiteral ? value : `() => ${value}`
+ return isLiteral ? value : `() => (${value})`
}
}