Skip to content

Commit

Permalink
fix: 隐藏border选项
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLanniste authored and Qiu-Jun committed Jul 8, 2024
1 parent 5250a3e commit 4136b68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/core/plugin/GroupPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class GroupPlugin implements IPluginTempl {
this.canvas.remove(object);
});
this.canvas.add(newgroup);
this.canvas.setActiveObject(newgroup);
});
}

Expand Down
9 changes: 6 additions & 3 deletions src/components/attributeBorder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Description: 边框
-->
<template>
<div class="box attr-item-box" v-if="mixinState.mSelectMode === 'one'">
<div class="box attr-item-box" v-if="mixinState.mSelectMode === 'one' && !isGroup">
<!-- <h3>边框</h3> -->
<Divider plain orientation="left"><h4>边框</h4></Divider>
<!-- 通用属性 -->
Expand Down Expand Up @@ -53,7 +53,6 @@
</Col>
</Row>
</div>
<!-- <Divider plain></Divider> -->
</div>
</template>

Expand All @@ -64,6 +63,7 @@ import InputNumber from '@/components/inputNumber';
const update = getCurrentInstance();
const { mixinState, canvasEditor } = useSelect();
const groupType = ['group'];
// 属性值
const baseAttr = reactive({
stroke: '#fff',
Expand Down Expand Up @@ -145,12 +145,15 @@ const strokeDashList = [
label: 'Dash-8',
},
];
const isGroup = computed(() => groupType.includes(mixinState.mSelectOneType));
// 属性获取
const getObjectAttr = (e) => {
const activeObject = canvasEditor.canvas.getActiveObject();
// 不是当前obj,跳过
if (e && e.target && e.target !== activeObject) return;
if (activeObject) {
if (activeObject && !groupType.includes(activeObject.type)) {
baseAttr.stroke = activeObject.get('stroke');
baseAttr.strokeWidth = activeObject.get('strokeWidth');
const strokeDashArray = JSON.stringify(activeObject.get('strokeDashArray') || []);
Expand Down

0 comments on commit 4136b68

Please sign in to comment.