UNPKG

@jay.kou/rak-ssr

Version:

A react based UI components for admin system

28 lines (26 loc) 845 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = require("react"); var _jsxRuntime = require("react/jsx-runtime"); /** * 模拟表单中的一个简单控件 */var SimpleComponent = function SimpleComponent(props) { var _props$value = props.value, value = _props$value === void 0 ? '' : _props$value, onChange = props.onChange, testid = props.testid; // 确保组件挂载时触发 onChange (0, _react.useEffect)(function () { onChange === null || onChange === void 0 || onChange(value); }, [value]); return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", { "data-testid": testid || 'display-value', children: value }) }); }; var _default = exports.default = SimpleComponent;