我有一个弹出窗口位于屏幕的中央,有:transform: translate(-50%, -50%);和position: absolute.不幸的是由于某种原因我的宽度是固定的,它不是动态的(基于内容).
这是我的jsfiddle:https://jsfiddle.net/qh13mnaf/1/
为什么弹出窗口的宽度不大?
如何从此数组中获取唯一记录.我需要{{ subitem.author }}从这一系列项目中获得独特性.
<div *ngFor="let item of items">
<ion-list *ngFor="let subitem of item.items" (click)="authorquotes(subitem.author);">
<ion-item >
{{ subitem.author }}
</ion-item>
</ion-list>
</div>
Run Code Online (Sandbox Code Playgroud)
在具有多个记录的数组中.从那个数组中,我需要过滤独特的作者.
我在https://reactnavigation.org/docs/navigators/drawer中使用DrawerNavigator .
const MyApp = DrawerNavigator({
Home: {
screen: MyHomeScreen,
},
Notifications: {
screen: MyNotificationsScreen,
},
});
Run Code Online (Sandbox Code Playgroud)
我有多个屏幕使用MyNotificationsScreen具有不同道具的组件.
我该怎么做:
const MyApp = DrawerNavigator({
Home: {
screen: MyHomeScreen,
},
Notifications1: {
screen: MyNotificationsScreen(propName=val1),
},
Notifications2: {
screen: MyNotificationsScreen(propName=val2),
},
});
Run Code Online (Sandbox Code Playgroud) 我有一个显示向控制台日志的jscript:
x.js包含
function open() {
console.log('this a function');
}
Run Code Online (Sandbox Code Playgroud)
在我的应用程序的index.html中
<script src="x.js"></script>
Run Code Online (Sandbox Code Playgroud)
在我的组件中
declare var xJS : any;;
@Component({
selector: 'employerfile',
templateUrl: './employerfile.component.html'
})
export class EmployerFileComponent
.....
openURL() {
xJS.open();
}
}
Run Code Online (Sandbox Code Playgroud)
在HTML
<a (click)="openURL()"> click </a>
Run Code Online (Sandbox Code Playgroud)
执行此代码时,出现异常@
原始异常:未定义xJS
如何调用此外部函数?
我正在将React Navigation与React Native一起使用。这是在Android上。
我试图在图标和标签栏顶部之间增加一些间距,并减小图标和标签之间的间距。
我正在尝试更改底部边框的颜色,即黄线。
我试图减少间距,在每个单元格内左右填充。
知道我该如何实现吗?
{
tabBarPosition: 'bottom',
animationEnabled: true,
swipeEnabled: true,
tabBarOptions: {
showIcon: true,
labelStyle: {
fontSize: 8
},
style: {
backgroundColor: 'grey',
},
tabStyle: {
height: 49
},
iconStyle: {
flexGrow: 0,
marginTop: 1.5
}
}
}
Run Code Online (Sandbox Code Playgroud)
我从头开始了一个 React Native 项目并配置了 Flow。
当我运行时,npm run flow除了react-native模块的一个小问题外,一切正常:
无法解析模块 react-native。
我在用:
"react": "16.3.1",
"react-native": "0.55.3",
"flow-bin": "0.74.0"
Run Code Online (Sandbox Code Playgroud)
我的.flowconfig是:
[ignore]
.*/node_modules/.*
.*/.cache/.*
.*/test/.*
[include]
[libs]
[lints]
[options]
[strict]
Run Code Online (Sandbox Code Playgroud)
尝试过"flow-typed": "2.4.0"但没有用。
我发现了以下问题,但没有任何解决方案:/
我正在寻找一种方法来制作项目后的动画平面列表项目.当一个项目完成动画时,下一个项目(来自平面列表)将出现在屏幕上
class AnimatedFlatList extends React.PureComponent {
state = {selected: (new Map(): Map<string, boolean>)};
let data = {[
{"first_name":"ltorrejon0@si.edu"},
{"first_name":"ichadbourne1@icq.com"},
{"first_name":"ascorthorne2@mediafire.com"},
{"first_name":"jlathwood3@xing.com"},
{"first_name":"molkowicz4@ftc.gov"},
{"first_name":"motridge5@tiny.cc"},
{"first_name":"rcess6@hostgator.com"},
{"first_name":"mmaundrell7@php.net"},
{"first_name":"ufairburne8@instagram.com"},
{"first_name":"pangel9@biglobe.ne.jp"}]
};
_keyExtractor = (item, index) => item.id;
_onPressItem = (id: string) => {
// updater functions are preferred for transactional updates
this.setState((state) => {
// copy the map rather than modifying state.
const selected = new Map(state.selected);
selected.set(id, !selected.get(id)); // toggle
return {selected};
});
};
_renderItem = (item) => (
<View style={Styles.viewItem}}>
<Text …Run Code Online (Sandbox Code Playgroud) 我第一次使用命令
$ bitbake machine-image -c populate_sdk
Run Code Online (Sandbox Code Playgroud)
全部处理成功,然后xxx.sh在deploy文件夹中生成了SDK shell脚本。
然后,我想在项目中添加一个新的配方,然后烘焙成功。接下来我想再次生成新的SDK,所以我删除了deploy下的SDK文件夹,再次bitbake,所有过程成功,但没有生成任何内容,即使我重新烘焙和重新烘焙图像,SDK也不会生成。
消息如:
NOTE: Tasks Summary: Attempted 3760 tasks of which 3760 didn't need to be rerun and all succeeded.
Run Code Online (Sandbox Code Playgroud)
我怎样才能触发这些re-populate流程?
我可以在 Firebase 身份验证中验证电子邮件域区域吗?
例如,我只想为来自 yahoo 和 gmail 的电子邮件( @yahoo.com、@gmail.com 电子邮件)提供成功注册
ps当然我可以在客户端验证它,但这还不够
我们如何使用redux在react-navigation中创建受保护的路由?
考虑我有一个包含以下状态的redux存储
const mapStateToProps = state => {
return {
isAuthenticated: state.profileInfo.isAuthenticated,
isLoaded: state.profileInfo.isLoaded,
googleProfileLoading: state.profileInfo.googleProfileLoading
}
};
Run Code Online (Sandbox Code Playgroud)
我正在使用React导航来导航用户。
const loginNavigation = createStackNavigator(
{
login: {
screen: Login
},
signup: {
screen: Signup
}
},
{
headerMode: "none"
}
)
const allRoutes = createSwitchNavigator(
{
home: {
screen: loginNavigation
},
user: {
screen: user
},
{
initialRouteName: "home"
}
);
const App = createAppContainer(allRoutes);
Run Code Online (Sandbox Code Playgroud)
现在,如果用户尚未登录,我想重定向到登录屏幕。
在简单的react-redux中,这通常是我通常要做的事情:https : //github.com/irohitb/SelfieApp/blob/master/client/src/routes.js
有人可以帮我弄清楚我们如何在react-native,redux和react-navigation中创建受保护的路由
我在create-react-native-app中使用React Navigation。
我正在使用这样的TabNavigator组件(iPhone SE):
这TabNavigator是深蓝色的条,带有“作业1”,“聊天”,“文件”,“详细信息”。
我要自定义这些项目的文本。我想要非大写的文本(据我所知,这是用React Native Stylesheet不可能实现的),并为包裹在两行上的'Details'项目应用修复程序。
我在TabNavigator上浏览了React Navigation API,但是找不到答案。
如何为这些物品定型?
我创建了一个名为 Class UserRequest 的 Mailable 我试图从控制器内部调用它,这是我得到的错误:
找不到类“App\Http\Controllers\UserRequest”
我也试过了,->send(new \UserRequest($msgdata));但还是不行。
控制器:
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Mail;
class ContactController extends Controller
{
public function index()
{
return view('contact');
}
public function sendemail(Request $request)
{
$msgdata = array('subject'=>$request->subject,'email'=>$request->email, 'name'=>$request->name,'body'=>$request->body);
try
{
Mail::to('dddddddd@dddsdsf.com')
->send(new UserRequest($msgdata));
}
catch(Exception $e)
{
}
}
}
Run Code Online (Sandbox Code Playgroud)