admin管理员组文章数量:1129441
I want to display some images as an option in select. how can I adjust the height of select object?
here is my code :
import { Form, Image, Layout, Select } from "antd";
import { React } from "react";
const { Content } = Layout;
function Ornek() {
return (
<Layout style={{ margin: 0, padding: 0 }}>
<Content style={{ padding: "0px" }}>
<Form autoComplete="off" labelCol={{ span: 7 }} wrapperCol={{ span: 16 }}>
<Form.Item name="ghsEtiket" label="GHS">
<Select multiple mode="tags">
<Select.Option value="1">
<Image src=".png" style={{ width: 50 }} />
</Select.Option>
<Select.Option value="2">
<img src=".png" style={{ width: 50 }} />
</Select.Option>
<Select.Option value="3">
<img src=".png" style={{ width: 50 }} />
</Select.Option>
</Select>
</Form.Item>
</Form>
</Content>
</Layout>
);
}
export default Ornek;
and the result is :
how can I display the whole image in the GHS section. I tried to change the height of select component but it doesn't worked.
I want to display some images as an option in select. how can I adjust the height of select object?
here is my code :
import { Form, Image, Layout, Select } from "antd";
import { React } from "react";
const { Content } = Layout;
function Ornek() {
return (
<Layout style={{ margin: 0, padding: 0 }}>
<Content style={{ padding: "0px" }}>
<Form autoComplete="off" labelCol={{ span: 7 }} wrapperCol={{ span: 16 }}>
<Form.Item name="ghsEtiket" label="GHS">
<Select multiple mode="tags">
<Select.Option value="1">
<Image src="https://pro.kmysistem.com/images/ghs01.png" style={{ width: 50 }} />
</Select.Option>
<Select.Option value="2">
<img src="https://pro.kmysistem.com/images/ghs02.png" style={{ width: 50 }} />
</Select.Option>
<Select.Option value="3">
<img src="https://pro.kmysistem.com/images/ghs03.png" style={{ width: 50 }} />
</Select.Option>
</Select>
</Form.Item>
</Form>
</Content>
</Layout>
);
}
export default Ornek;
and the result is :
how can I display the whole image in the GHS section. I tried to change the height of select component but it doesn't worked.
Share Improve this question asked Jan 8 at 9:46 Ufuk UgurUfuk Ugur 3462 silver badges18 bronze badges1 Answer
Reset to default 1finally I did it. ConfigProvider does the trick
here is the final code:
import { ConfigProvider, Form, Image, Layout, Select } from "antd";
import { React } from "react";
const { Content } = Layout;
function Ornek() {
return (
<Layout>
<Content style={{ padding: "20px" }}>
<Form autoComplete="off" labelCol={{ span: 7 }} wrapperCol={{ span: 16 }}>
<Form.Item name="ghsEtiket" label="GHS">
<ConfigProvider
theme={{
components: {
Select: {
multipleItemHeight: 50,
},
},
}}
>
<Select mode="tags">
<Select.Option value="1">
<Image src="https://pro.kmysistem.com/images/ghs01.png" style={{ width: 50 }} />
</Select.Option>
<Select.Option value="2">
<img src="https://pro.kmysistem.com/images/ghs02.png" style={{ width: 50 }} />
</Select.Option>
<Select.Option value="3">
<img src="https://pro.kmysistem.com/images/ghs03.png" style={{ width: 50 }} />
</Select.Option>
</Select>
</ConfigProvider>
</Form.Item>
</Form>
</Content>
</Layout>
);
}
export default Ornek;
本文标签: reactjsjust part of image is displaying in antd select componentStack Overflow
版权声明:本文标题:reactjs - just part of image is displaying in antd select component - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736743524a1950645.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论