Skip to content

Commit

Permalink
release: vue-class-setup@1.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lzxb committed Oct 20, 2023
1 parent a740f5f commit 52feb3a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.3.9

- fix: Type failure

## 1.3.8

- types: fix `DeepReadonly` to `Readonly`
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vue-class-setup",
"version": "1.3.8",
"version": "1.3.9",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
"types": "dist/index.d.ts",
Expand Down
11 changes: 7 additions & 4 deletions src/context.ts
Expand Up @@ -151,16 +151,19 @@ export class Context<T extends {} = {}, E extends DefaultEmit = DefaultEmit> {
public static inject<T extends new (...args: any) => any>(this: T) {
const _This = this;

return {
setup() {
return {} as Omit<InstanceType<T>, '$vm'>;
},
const options: any = {
created() {
const vm = this as any as VueInstance;
const app = use(vm, _This);
initInject(app, vm);
},
};

return options as {
setup?: () => Omit<InstanceType<T>, '$vm'>;
data?: () => Omit<InstanceType<T>, '$vm'>;
created(): void;
};
}
public $vm: VueInstance;
public $emit: E;
Expand Down

0 comments on commit 52feb3a

Please sign in to comment.