Skip to content

Commit

Permalink
fix: canvas api error (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexqi authored Mar 15, 2024
1 parent 38c89a8 commit 68637db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
iframeMonitoring()
initCanvas({ emit, renderer: detail, iframe: iframe.value, controller: props.controller })
useCanvas().renderer.value = window.api
useCanvas().renderer.value = { ...detail, ...window.canvasApi }
const doc = iframe.value.contentDocument
const win = iframe.value.contentWindow
Expand Down
14 changes: 9 additions & 5 deletions packages/canvas/src/components/render/RenderMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,19 @@ export const api = {
getGlobalState,
getDataSourceMap,
setDataSourceMap,
setGlobalState,
getCurrent,
setGlobalState
}

const canvasApi = {
getCurrent,
setLocales,
getNodeById: getNode,
updateRect,
addStyle,
addScript,
addStyle,
addScript,
canvasDispatch
}

window.api = api
window.Builtin = Builtin
window.canvasApi = canvasApi
window.Builtin = Builtin

0 comments on commit 68637db

Please sign in to comment.