::: details 目录 [[toc]] :::
::: details 示例代码
<<< @/docs/.vuepress/components/edit/items/editpolygon/editpolygon.vue
:::
::: details 查看代码
<<< @/docs/guides/edit/items/src/EditPolygonItem.ts
:::
``` js {4} // 编辑状态时的 LineItem this.polygonItem = new EditPolygonItem(null); this.polygonItem.status = SItemStatus.Create; this.scene.grabItem = this.polygonItem;
### 2 当 EditPolygonItem 为正常状态时,需要将 grabItem 置为 null
``` js {4}
// 正常状态时的 LineItem
this.polygonItem = new EditPolygonItem(null);
this.polygonItem.status = SItemStatus.Normal;
this.scene.grabItem = null;
``` js {3} // 编辑状态时的 LineItem this.polygonItem = new EditPolygonItem(null,); this.polygonItem.status = SItemStatus.Create; this.polygonItem.verAndLeve = true; this.scene.grabItem = this.polygonItem;
### 4 当 EditPolygonItem 修改属性但是画板尚未变化时需要刷新
``` js {4}
// 编辑状态时的 LineItem
this.polygonItem = new EditPolygonItem(null);
this.polygonItem.status = SItemStatus.Create;
this.view.update();
``` js {4} // 编辑状态时的 LineItem this.polygonItem = new EditPolygonItem(null); this.polygonItem.status = SItemStatus.Create; this.polygonItem.moveable = true;
### 6 当 EditPolygonItem 绘制完成后的回调函数为 finishCreated
``` js {4}
// 编辑状态时的 LineItem
this.polygonItem = new EditPolygonItem(null);
this.polygonItem.status = SItemStatus.Create;
this.polygonItem.connect("finishCreated", this, this.finishCreated);
this.polygonItem.moveable = true;
methods:{
finishCreated(){
}
}