Skip to content

Commit

Permalink
fix: remove unused api
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-wow committed Oct 30, 2024
1 parent eec6840 commit b6df90b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
3 changes: 0 additions & 3 deletions packages/canvas/render/src/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import TinyI18nHost, { I18nInjectionKey } from '@opentiny/tiny-engine-common/js/
import Main, { api } from '@opentiny/tiny-engine-renderer'
import lowcode from './lowcode'
import { supportUmdBlock } from './supportUmdBlock'
import CanvasEmpty from './CanvasEmpty.vue'

const dispatch = (name, data) => {
window.parent.document.dispatchEvent(new CustomEvent(name, data))
Expand Down Expand Up @@ -63,8 +62,6 @@ const create = async (config) => {

dispatch('canvasReady', { detail: renderer })

api.setCanvasEmptyComponent(CanvasEmpty)

App = createApp(Main).use(TinyI18nHost).provide(I18nInjectionKey, TinyI18nHost)

if (typeof appCreated === 'function') {
Expand Down
15 changes: 4 additions & 11 deletions packages/renderer/src/RenderMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
getCanvasFlag,
setCanvasFlag
} from './context'
import CanvasEmpty from './CanvasEmpty.vue'

const { BROADCAST_CHANNEL } = constants
const { parseFunction: generateFunction } = commonUtils
Expand Down Expand Up @@ -367,14 +368,7 @@ const setSchema = async (data) => {

const getNode = (id, parent) => (id ? getNodeById(id, parent) : schema)

let CanvasEmptyComponent = null

const getCanvasEmptyComponent = () => (CanvasEmptyComponent ? h(CanvasEmptyComponent) : null)

const setCanvasEmptyComponent = (component) => {
CanvasEmptyComponent = component
}

// 设置自定义渲染器
let canvasRenderer = null

const defaultRenderer = function () {
Expand All @@ -394,7 +388,7 @@ const defaultRenderer = function () {
ref: 'page',
className: 'design-page'
},
schema.children?.length ? h(renderer, { schema: rootChildrenSchema, parent: schema }) : getCanvasEmptyComponent()
schema.children?.length ? h(renderer, { schema: rootChildrenSchema, parent: schema }) : [h(CanvasEmpty)]
)
}

Expand Down Expand Up @@ -477,6 +471,5 @@ export const api = {
getBlockSlotDataMap,
getComponent,
getCanvasFlag,
setCanvasFlag,
setCanvasEmptyComponent
setCanvasFlag
}

0 comments on commit b6df90b

Please sign in to comment.