Skip to content

Commit

Permalink
fix: dynamic attr name
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyun8 committed Oct 8, 2024
1 parent 3cad14b commit aa3fd37
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/canvas/container/src/CanvasContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@
<canvas-resize>
<template v-if="!loading">
<iframe
v-if="canvasSrc"
id="canvas"
ref="iframe"
:src="canvasSrc"
style="border: none; width: 100%; height: 100%"
></iframe>
<iframe
v-else
id="canvas"
ref="iframe"
:srcdoc="canvasSrcDoc"
:[srcAttrName]="canvasSrc || canvasSrcDoc"
style="border: none; width: 100%; height: 100%"
></iframe>
</template>
Expand Down Expand Up @@ -83,6 +75,7 @@ export default {
const loading = computed(() => useCanvas().isLoading())
let showSettingModel = ref(false)
let target = ref(null)
const srcAttrName = computed(() => (props.canvasSrc ? 'src' : 'srcdoc'))
const setCurrentNode = async (event) => {
const { clientX, clientY } = event
Expand Down Expand Up @@ -251,7 +244,8 @@ export default {
target,
showSettingModel,
insertPosition,
loading
loading,
srcAttrName
}
}
}
Expand Down

0 comments on commit aa3fd37

Please sign in to comment.