反应本机 - 图像标签需要警告
在下面的代码中,我尝试显示带有本地路径的图像,我创建了我的项目中的特定目录。
例如:
props.item.url ='Assets/logos/some-id/some-image-name.png'
<Image source={require(`../../../../${props.item.url}`)} style={{ width: "100%", height: "100%" }} resizeMode={"contain"} />
查看下面的警告,在不同文件中的某些警告中显示
了一些警告。 ./components/menu/sub-menu/new/templates/test.json 模块解析失败:意外的令牌{在近距离解析近“ ...”方向时,位于位置7651的JSON:1 }
{ “锁”:2, ...' 您可能需要一个适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。请参阅 https://webpack.js.ss.org/conepts#loaders syntaxerror:意外的令牌{在json的位置7651时,解析附近'...“方向”:1 }
{ “锁”:2, ...' 在json.parse()
./services/localization/config/translate_thai.json 模块解析失败:json在165位置的意外令牌,而在“ ... teamShortName”附近解析时:{{ },, “ Teamlo ...' 您可能需要一个适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。请参阅 https://webpack.js.ss.org/conepts#loaders SyntaxError:在JSON的位置165的JSON中出现的令牌,而在“ ... TeamShortName”附近解析”:{ },, “ Teamlo ...' 在json.parse()
In the code below, I try to display an image with a local path that I create to navigate to a specific directory in my project.
for example:
props.item.url = 'assets/logos/some-id/some-image-name.png'
<Image source={require(`../../../../${props.item.url}`)} style={{ width: "100%", height: "100%" }} resizeMode={"contain"} />
Look at the warning below, some warnings in different file are appear
Compiled with warnings.
./components/menu/sub-menu/new/templates/test.json
Module parse failed: Unexpected token { in JSON at position 7651 while parsing near '... "direction": 1
}
{
"lock": 2,
...'
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
SyntaxError: Unexpected token { in JSON at position 7651 while parsing near '... "direction": 1
}
{
"lock": 2,
...'
at JSON.parse ()
./services/localization/config/translate_thai.json
Module parse failed: Unexpected token in JSON at position 165 while parsing near '...TeamShortName" :{
},
"TeamLo...'
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
SyntaxError: Unexpected token in JSON at position 165 while parsing near '...TeamShortName" :{
},
"TeamLo...'
at JSON.parse ()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)