Skip to content

Commit

Permalink
fix: 区块修复城市联级选择器ts报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
syb01094648 committed Sep 26, 2023
1 parent 329c967 commit 2597142
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/blocks/administrative-select/demos/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default () => {
setValue(e);
}}
value={value}
style={{ width: 250 }}
/>
</LarkMap>
);
Expand Down
7 changes: 4 additions & 3 deletions docs/blocks/administrative-select/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LineLayerProps } from '@antv/larkmap';
import { CustomControl, LineLayer, useScene } from '@antv/larkmap';
import type { Feature, MultiLineString} from '@turf/turf';
import type { Feature, MultiLineString } from '@turf/turf';
import { featureCollection, multiLineString } from '@turf/turf';
import { Cascader, message } from 'antd';
import React, { useEffect, useState } from 'react';
Expand All @@ -25,6 +25,7 @@ export const AdministrativeSelect: React.FC<AdministrativeSelectProps> = ({
autoFit,
boundaryLayer,
value,
multiple,
onChange,
...props
}) => {
Expand Down Expand Up @@ -104,8 +105,8 @@ export const AdministrativeSelect: React.FC<AdministrativeSelectProps> = ({
allowClear={allowClear}
placeholder={placeholder}
changeOnSelect={changeOnSelect}
style={style}
expandTrigger={expandTrigger}
multiple={multiple}
{...props}
/>
</CustomControl>
Expand All @@ -126,8 +127,8 @@ AdministrativeSelect.defaultProps = {
expandTrigger: 'hover',
allowClear: true,
changeOnSelect: true,
style: { width: 250 },
enableBoundary: true,
autoFit: true,
boundaryLayer: defaultLayerOptions,
multiple: false,
};
3 changes: 2 additions & 1 deletion docs/blocks/administrative-select/type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { LineLayerProps } from '@antv/larkmap';
import type { CascaderProps } from 'antd';

export interface AdministrativeSelectProps extends Omit<CascaderProps, 'value' | 'options' | 'onChange'> {
export interface AdministrativeSelectProps extends Omit<CascaderProps, 'value' | 'options' | 'onChange' | 'multiple'> {
value: string[];
onChange?: (value: string[], selectedOptions: any) => void;
/**
Expand All @@ -16,4 +16,5 @@ export interface AdministrativeSelectProps extends Omit<CascaderProps, 'value' |
* layer属性
*/
boundaryLayer?: Omit<LineLayerProps, 'source'>;
multiple?: boolean;
}

0 comments on commit 2597142

Please sign in to comment.