Skip to content

Commit 14b7035

Browse files
committed
1 parent f910791 commit 14b7035

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.4.2
2+
3+
- fix: Type failure
4+
15
## 1.4.1
26

37
- fix: Type failure

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-class-setup",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"main": "dist/index.cjs.js",
55
"module": "dist/index.es.js",
66
"types": "dist/index.d.ts",

src/context.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ export class Context<T extends {} = {}, E extends DefaultEmit = DefaultEmit> {
160160
};
161161

162162
return options as {
163-
setup: () => Omit<InstanceType<T>, `$${any}`>;
164-
data: () => Omit<InstanceType<T>, `$${any}`>;
163+
data: () => Omit<InstanceType<T>, `$${string}`>;
165164
created(): void;
166165
};
167166
}

src/define.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ type DefineInstanceType<
1616
> = Readonly<T> & DefineInstance<T, E>;
1717

1818
export interface DefineConstructor {
19-
inject: typeof Context['inject'];
20-
use: typeof Context['use'];
21-
setup: typeof Context['setup'];
22-
setupOptions: typeof Context['setupOptions'];
19+
inject: (typeof Context)['inject'];
20+
use: (typeof Context)['use'];
21+
setup: (typeof Context)['setup'];
22+
setupOptions: (typeof Context)['setupOptions'];
2323
setupDefine: boolean;
2424
setupPropertyDescriptor: Map<string, PropertyDescriptor>;
2525
new <T extends {} = {}, E extends DefaultEmit = DefaultEmit>(

src/setup.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import { setupReference } from './setup-reference';
1414
import { getPropertyDescriptors } from './property-descriptors';
1515

1616
export type TargetConstructor = {
17-
use: typeof Context['use'];
18-
inject: typeof Context['inject'];
19-
setup: typeof Context['setup'];
20-
setupOptions: typeof Context['setupOptions'];
17+
use: (typeof Context)['use'];
18+
inject: (typeof Context)['inject'];
19+
setup: (typeof Context)['setup'];
20+
setupOptions: (typeof Context)['setupOptions'];
2121
setupPropertyDescriptor: Map<string, PropertyDescriptor>;
2222
new (...args: any[]): any;
2323
};

tests/boolean-props.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ test('Base', async () => {
2525
wrapper.setProps({
2626
boolean1: false,
2727
boolean3: true,
28+
// @ts-ignore
2829
boolean5: '',
30+
// @ts-ignore
2931
boolean6: '',
32+
// @ts-ignore
3033
showIcon: '',
3134
age1: 100,
3235
age2: 10,
@@ -47,6 +50,7 @@ test('Base', async () => {
4750
wrapper.setProps({
4851
boolean1: true,
4952
boolean4: false,
53+
// @ts-ignore
5054
age1: null,
5155
});
5256
await wrapper.vm.$nextTick();

0 commit comments

Comments
 (0)