Cédric Exbrayat
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
3 deletions
-
packages/compiler-sfc/__tests__/compileScript/defineOptions.spec.ts
-
packages/compiler-sfc/src/script/defineProps.ts
-
packages/runtime-core/src/apiSetupHelpers.ts
|
|
@ -28,7 +28,7 @@ describe('defineOptions()', () => { |
|
|
|
expect(content).not.toMatch('defineOptions') |
|
|
|
}) |
|
|
|
|
|
|
|
it('should emit an error with two defineProps', () => { |
|
|
|
it('should emit an error with two defineOptions', () => { |
|
|
|
expect(() => |
|
|
|
compile(`
|
|
|
|
<script setup> |
|
|
|
|
|
@ -325,7 +325,7 @@ function genDestructuredDefaultValue( |
|
|
|
// If the default value is a function or is an identifier referencing
|
|
|
|
// external value, skip factory wrap. This is needed when using
|
|
|
|
// destructure w/ runtime declaration since we cannot safely infer
|
|
|
|
// whether tje expected runtime prop type is `Function`.
|
|
|
|
// whether the expected runtime prop type is `Function`.
|
|
|
|
const needSkipFactory = |
|
|
|
!inferredType && |
|
|
|
(isFunctionType(unwrapped) || unwrapped.type === 'Identifier') |
|
|
|
|
|
@ -176,7 +176,7 @@ export function defineExpose< |
|
|
|
/** |
|
|
|
* Vue `<script setup>` compiler macro for declaring a component's additional |
|
|
|
* options. This should be used only for options that cannot be expressed via |
|
|
|
* Composition API - e.g. `inhertiAttrs`. |
|
|
|
* Composition API - e.g. `inheritAttrs`. |
|
|
|
* |
|
|
|
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
|
|
|
*/ |
|
|
|