核心内容摘要
久久精品网:点亮你的生活,不止于精彩
代码// 处理数字输入只能输入数字不能输入其他符号 const handleNumberInput (value: string) { // 过滤掉所有非数字字符只保留数字 const numbersOnly value.replace(/[^\d]/g, ); // 转换为数字空字符串设为0 localCapitalInfo.capitalYear numbersOnly ? 0 : parseInt(numbersOnly,
代码// 处理数字输入只能输入数字不能输入其他符号 const handleNumberInput (value: string) { // 过滤掉所有非数字字符只保留数字 const numbersOnly value.replace(/[^\d]/g, ); // 转换为数字空字符串设为0 localCapitalInfo.capitalYear numbersOnly ? 0 : parseInt(numbersOnly,