Skip to content

Commit

Permalink
fix: 位置组件
Browse files Browse the repository at this point in the history
  • Loading branch information
yxh01132861 committed Sep 20, 2023
1 parent 6015e07 commit d6ef7db
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 33 deletions.
2 changes: 1 addition & 1 deletion examples/builder/src/constans/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ const DEFAULT_ANALYSIS_APP: Application = {
select: { fillColor: false, strokeColor: 'red' },
},
label: {
field: '',
field: undefined,
visible: false,
style: {
fill: '#454d64',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
/* eslint-disable react/no-array-index-key */
import { usePrefixCls } from '@formily/antd-v5/esm/__builtins__';
import type { SelectProps } from 'antd';
import { Select } from 'antd';
import cls from 'classnames';
import React from 'react';
import { POSITION } from './contants';
import useStyle from './style';

const PositionSelect: React.FC<SelectProps> = (props) => {
const { options, ...prop } = props;
const prefixCls = usePrefixCls('formily-position-select');
const [wrapSSR, hashId] = useStyle(prefixCls);

return wrapSSR(
<Select {...prop} popupClassName={cls(`${prefixCls}`, hashId)}>
{(options ?? POSITION).map((item, index) => {
return (
<Select.Option value={item.value} key={index}>
<div className={cls(`${prefixCls}-item`, hashId)}>
<span>{item.label}</span>
</div>
</Select.Option>
);
})}
</Select>,
);
return <Select {...prop} options={options ?? POSITION} />;
};

export default PositionSelect;

This file was deleted.

0 comments on commit d6ef7db

Please sign in to comment.