mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-05 19:41:40 +08:00
feat(vue-runtime-help): useDsl/useEditorDsl添加app默认参数
This commit is contained in:
parent
a293bd8d3f
commit
f671c670db
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"name": "@tmagic/vue-runtime-help",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
|
@ -1,12 +1,10 @@
|
||||
import { inject, nextTick, onBeforeUnmount, reactive, ref } from 'vue-demi';
|
||||
|
||||
import type TMagicCore from '@tmagic/core';
|
||||
import type TMagicApp from '@tmagic/core';
|
||||
import type { ChangeEvent, MNode } from '@tmagic/core';
|
||||
import { isPage, replaceChildNode } from '@tmagic/core';
|
||||
|
||||
export const useDsl = () => {
|
||||
const app = inject<TMagicCore>('app');
|
||||
|
||||
export const useDsl = (app = inject<TMagicApp>('app')) => {
|
||||
if (!app) {
|
||||
throw new Error('useDsl must be used after MagicApp is created');
|
||||
}
|
||||
|
@ -11,9 +11,7 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
export const useEditorDsl = (win = window) => {
|
||||
const app = inject<TMagicApp>('app');
|
||||
|
||||
export const useEditorDsl = (app = inject<TMagicApp>('app'), win = window) => {
|
||||
const root = ref<MApp>();
|
||||
const curPageId = ref<Id>();
|
||||
const selectedId = ref<Id>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user