0.0.3 • Published 6 years ago
dw-mx-code v0.0.3
Code
为 antd 组件增加 code 功能。
安装
npm install dw-mx-codeor
yarn add dw-mx-code使用
目前能与 code 组件配合使用的 antd 组件有:Radio、Checkbox、Select。
详细使用 => 使用示例
Radio
import React from "react";
import { Radio } from "antd";
import Code from "dw-mx-code";
const RadioGroupWithCode = props => {
return (
<Code value={"1:男,2:女"}>
<Radio.Group />
</Code>
);
};
export default RadioGroupWithCode;Checkbox
import React from "react";
import { Checkbox } from "antd";
import Code from "dw-mx-code";
const CheckboxGroupWithCode = props => {
return (
<Code value={"1:男,2:女"}>
<Checkbox.Group />
</Code>
);
};
export default CheckboxGroupWithCode;Select
import React from "react";
import { Select } from "antd";
import Code from "dw-mx-code";
const SelectWithCode = props => {
return (
<Code value={"1:男,2:女"}>
<Select />
</Code>
);
};
export default SelectWithCode;