UNPKG

@antmjs/vantui

Version:

一套适用于Taro3及React的vantui组件库

41 lines 1.53 kB
import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; /* eslint-disable */ import react from 'react'; import { RadioGroup, Radio, Image } from '@antmjs/vantui'; import { jsx as _jsx } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; export default function Demo() { var _react$useState = react.useState('1'), _react$useState2 = _slicedToArray(_react$useState, 2), value = _react$useState2[0], setValue = _react$useState2[1]; return /*#__PURE__*/_jsxs(RadioGroup, { value: value, onChange: function onChange(e) { return setValue(e.detail); }, children: [/*#__PURE__*/_jsx(Radio, { name: "1", renderIcon: /*#__PURE__*/_jsx(Image, { style: { width: '32px', height: '32px' }, src: value === '2' ? 'https://img.yzcdn.cn/public_files/2017/10/13/c547715be149dd3faa817e4a948b40c4.png' : 'https://img.yzcdn.cn/public_files/2017/10/13/793c77793db8641c4c325b7f25bf130d.png' }), shape: "square", children: "\u5355\u9009\u6846 1" }), /*#__PURE__*/_jsx(Radio, { name: "2", renderIcon: /*#__PURE__*/_jsx(Image, { style: { width: '32px', height: '32px' }, src: value === '1' ? 'https://img.yzcdn.cn/public_files/2017/10/13/c547715be149dd3faa817e4a948b40c4.png' : 'https://img.yzcdn.cn/public_files/2017/10/13/793c77793db8641c4c325b7f25bf130d.png' }), shape: "square", children: "\u5355\u9009\u6846 2" })] }); }