Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxb committed Dec 24, 2023
1 parent f910791 commit 14b7035
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.4.2

- fix: Type failure

## 1.4.1

- fix: Type failure
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-class-setup",
"version": "1.4.1",
"version": "1.4.2",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ export class Context<T extends {} = {}, E extends DefaultEmit = DefaultEmit> {
};

return options as {
setup: () => Omit<InstanceType<T>, `$${any}`>;
data: () => Omit<InstanceType<T>, `$${any}`>;
data: () => Omit<InstanceType<T>, `$${string}`>;
created(): void;
};
}
Expand Down
8 changes: 4 additions & 4 deletions src/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ type DefineInstanceType<
> = Readonly<T> & DefineInstance<T, E>;

export interface DefineConstructor {
inject: typeof Context['inject'];
use: typeof Context['use'];
setup: typeof Context['setup'];
setupOptions: typeof Context['setupOptions'];
inject: (typeof Context)['inject'];
use: (typeof Context)['use'];
setup: (typeof Context)['setup'];
setupOptions: (typeof Context)['setupOptions'];
setupDefine: boolean;
setupPropertyDescriptor: Map<string, PropertyDescriptor>;
new <T extends {} = {}, E extends DefaultEmit = DefaultEmit>(
Expand Down
8 changes: 4 additions & 4 deletions src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { setupReference } from './setup-reference';
import { getPropertyDescriptors } from './property-descriptors';

export type TargetConstructor = {
use: typeof Context['use'];
inject: typeof Context['inject'];
setup: typeof Context['setup'];
setupOptions: typeof Context['setupOptions'];
use: (typeof Context)['use'];
inject: (typeof Context)['inject'];
setup: (typeof Context)['setup'];
setupOptions: (typeof Context)['setupOptions'];
setupPropertyDescriptor: Map<string, PropertyDescriptor>;
new (...args: any[]): any;
};
Expand Down
4 changes: 4 additions & 0 deletions tests/boolean-props.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ test('Base', async () => {
wrapper.setProps({
boolean1: false,
boolean3: true,
// @ts-ignore
boolean5: '',
// @ts-ignore
boolean6: '',
// @ts-ignore
showIcon: '',
age1: 100,
age2: 10,
Expand All @@ -47,6 +50,7 @@ test('Base', async () => {
wrapper.setProps({
boolean1: true,
boolean4: false,
// @ts-ignore
age1: null,
});
await wrapper.vm.$nextTick();
Expand Down

0 comments on commit 14b7035

Please sign in to comment.