We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var images = ["image!tabbar-icon", "image!tabbar-icon", "image!tabbar-icon"]; var items = []; for(var i in titles) { var item = ( <TabBarIOS.Item title={titles[i]} icon={require(images[i])} onPress={this.select.bind(this, titles[i])} selected={this.state.tab == titles[i]}> {pages[i]} </TabBarIOS.Item> ); items.push(item); }
这里icon,如果我写成字符串require('image!tabbar-icon')就没有问题,就像上述代码片段,编译器就会默认我require了一个模块,不知道什么问题。错误如下: Requiring unknown module 'image!tabbar-icon'.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
var images = ["image!tabbar-icon", "image!tabbar-icon", "image!tabbar-icon"];
var items = [];
for(var i in titles)
{
var item = (
<TabBarIOS.Item
title={titles[i]}
icon={require(images[i])}
onPress={this.select.bind(this, titles[i])}
selected={this.state.tab == titles[i]}>
{pages[i]}
</TabBarIOS.Item>
);
items.push(item);
}
这里icon,如果我写成字符串require('image!tabbar-icon')就没有问题,就像上述代码片段,编译器就会默认我require了一个模块,不知道什么问题。错误如下:
Requiring unknown module 'image!tabbar-icon'.
The text was updated successfully, but these errors were encountered: