Skip to content

Commit

Permalink
feat: adapt material and block
Browse files Browse the repository at this point in the history
  • Loading branch information
hexqi committed Sep 3, 2024
1 parent 1ed870c commit 2055c3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/canvas/container/src/components/CanvasMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
</ul>
</li>
</ul>
<SaveNewBlock :boxVisibility="boxVisibility" fromCanvas @close="close"></SaveNewBlock>
<SaveNewBlock v-if="hasBlock" :boxVisibility="boxVisibility" fromCanvas @close="close"></SaveNewBlock>
</div>
</template>

<script lang="jsx">
import { ref, reactive, nextTick } from 'vue'
import { canvasState, getConfigure, getController, getCurrent, copyNode, removeNodeById } from '../container'
import { useLayout, useModal, useCanvas } from '@opentiny/tiny-engine-meta-register'
import { useLayout, useModal, useCanvas, getMetaApi, META_SERVICE } from '@opentiny/tiny-engine-meta-register'
import { iconRight } from '@opentiny/vue-icon'
const menuState = reactive({
Expand Down Expand Up @@ -227,6 +227,7 @@ export default {
}
return {
hasBlock: getMetaApi(META_SERVICE.Block),
menuState,
menus,
doOperation,
Expand Down
4 changes: 2 additions & 2 deletions packages/common/component/ProgressBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default {
TinyProgress
},
setup() {
const { getEditBlock } = getMetaApi(META_APP.BlockManage)
const editBlock = computed(getEditBlock)
const { getEditBlock } = getMetaApi(META_APP.BlockManage) || {}
const editBlock = getEditBlock ? computed(getEditBlock) : null
return {
editBlock
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/materials/src/composable/useMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ export default function () {
clearBlockResources, // 清空区块缓存,以便更新最新版区块
getMaterial, // 获取单个物料,(property) getMaterial: (name: string) => Material
setMaterial, // 设置单个物料 (property) setMaterial: (name: string, data: Material) => void
addMaterials, // 添加多个物料
registerBlock, // 注册新的区块
updateCanvasDependencies, //传入新的区块,获取新增区块的依赖,更新画布中的组件依赖
getConfigureMap // 获取物料组件的配置信息
Expand Down

0 comments on commit 2055c3e

Please sign in to comment.