我想显示 % 值的输入。当我记录它时,它显示正确但无法在页面中显示。想要在输入部分下方显示 % 值的输入
const [rcommission, setRcommission] = useState({
aeps: "",
matm: "",
});
let name,value;
const getRetailData = (event) => {
name= event.target.name;
value= event.target.value;
setRcommission({ ...rcommission, [name]:value });
let aeps = Number(value);
aeps *= 0.03;
let matm = Number(value);
matm *= 0.04;
if (name === 'aeps') {
console.log(aeps);
} else if (name === 'matm') {
console.log(matm);
}
};
这是输入秒
<input name="aeps"
type="number"
value={rcommission.aeps}
onChange={getRetailData}
id="ContentPlaceHolder1_txtname"
className="form-control"
autoComplete="off"
placeholder=" AEPS" />
<div className="help-block with-errors"></div>
</div>
<span> {rcommission.aeps} </span>