![](/img/trans.png)
[英]Uncaught TypeError: Cannot read property 'toLocaleString' of undefined
[英]how to fix the Uncaught TypeError: Cannot read properties of undefined (reading 'toLocaleString')
const month=props.date.toLocaleString('en-US', {month:'long'});
该代码显示输入数据错误,但完全适用于虚拟数据,我尝试了 toLocaleString 的其他数据类型,但它不起作用
您的属性数据未定义,请尝试添加对属性数据的检查
const month = props.date? props.date.toLocaleString('en-US', {month:'long'}): null;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.