Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: optimize block and material scalability issue #788

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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