diff --git a/src/components/AMapPolyline/stories/AMapPolyline.stories.tsx b/src/components/AMapPolyline/stories/AMapPolyline.stories.tsx index 015ca04..96e5f8d 100644 --- a/src/components/AMapPolyline/stories/AMapPolyline.stories.tsx +++ b/src/components/AMapPolyline/stories/AMapPolyline.stories.tsx @@ -5,6 +5,8 @@ import { actions } from '@storybook/addon-actions'; import { AMapPolyline, AMapPolylineProps, + AMapPolylineEditor, + AMapPolylineEditorProps, } from '../../../index'; import withAutoFitView from '../../../storybook-decorators/withAutoFitView'; @@ -279,6 +281,21 @@ export const CommonUse: typeof Template = Template.bind({}); CommonUse.storyName = '一般使用'; CommonUse.args = {}; +const { onChange } = actions('onChange'); +const $polyline = React.createRef(); +const computeTarget: AMapPolylineEditorProps['computeTarget'] = (polygons) => polygons?.find( + (polygon) => polygon === $polyline.current, +); + +export const Editable: Story = (args) => ( + <> + + + +); +Editable.storyName = '支持编辑'; +Editable.args = {}; + export const Draggable: typeof Template = Template.bind({}); Draggable.storyName = '可拖拽'; Draggable.args = {