@antmjs/vantui
Version:
一套适用于Taro3及React的vantui组件库
37 lines • 1.43 kB
JavaScript
import { View, Button, Image } from '@tarojs/components';
import * as utils from '../wxs/utils';
import * as computed from './wxs';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export default function Index(props) {
var showBorder = props.showBorder,
onSelect = props.onSelect,
options = props.options;
return /*#__PURE__*/_jsx(View, {
className: utils.bem('share-sheet__options', {
border: showBorder
}),
children: options.map(function (item, index) {
return /*#__PURE__*/_jsx(View, {
className: "van-share-sheet__option",
onClick: function onClick() {
return onSelect === null || onSelect === void 0 ? void 0 : onSelect(item, index);
},
children: /*#__PURE__*/_jsxs(Button, {
className: "van-share-sheet__button",
"open-type": item.openType || '',
children: [item.renderIcon ? item.renderIcon : /*#__PURE__*/_jsx(Image, {
src: computed.getIconURL(item.icon),
className: "van-share-sheet__icon"
}), item.name && /*#__PURE__*/_jsx(View, {
className: "van-share-sheet__name",
children: item.name
}), item.description && /*#__PURE__*/_jsx(View, {
className: "van-share-sheet__option-description",
children: item.description
})]
})
}, index);
})
});
}