@antmjs/vantui
Version:
一套适用于Taro3及React的vantui组件库
60 lines (59 loc) • 1.59 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = Index;
var _vantui = require("@antmjs/vantui");
var _jsxRuntime = require("react/jsx-runtime");
var Dialog_ = _vantui.Dialog.createOnlyDialog();
function Index() {
var form = _vantui.Form.useForm();
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Dialog_, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.FormRender, {
form: form,
config: [{
fields: 'account',
type: 'inputNumber',
required: true,
label: '账号'
}, {
fields: 'name',
type: 'input',
label: '名称'
}, {
fields: 'radio',
type: 'radio',
label: '价格',
options: [{
name: '选项1',
value: '1'
}, {
name: '选项2',
value: '2'
}]
}, {
fields: 'price',
type: 'inputPrice',
label: '价格'
}]
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_vantui.Button, {
style: {
width: '100%',
marginTop: '20px'
},
type: "primary",
onClick: function onClick() {
console.info(form.getFieldsValue());
form.validateFields(function (err, res) {
console.info(form.getFieldsValue());
if (!(err !== null && err !== void 0 && err.length)) {
Dialog_.alert({
message: JSON.stringify(res)
});
}
});
},
children: "\u63D0\u4EA4"
})]
});
}
;