小编jro*_*occ的帖子

React Navigation中的标签导航器图标

我正在使用react-navigation v2和react本地矢量图标。

我正在尝试在react native选项卡导航器中添加一个图标。

如果图标不在选项卡导航器中,则会显示该图标。该图标未在选项卡导航器中显示,并且我找不到如何在选项卡导航器中添加图标的可靠示例。

import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';

import { createMaterialTopTabNavigator } from 'react-navigation'

import Home from '../HomePage.js'
import Profile s from '../ProfilePage.js'

import Icon from 'react-native-vector-icons/FontAwesome';

export const Tabs = createMaterialTopTabNavigator(
  {
    HomePage: {
      screen: Home,

      navigationOptions: {
        tabBarLabel:"Home Page",
        tabBarIcon: ({ tintColor }) => (
          <Icon name="home" size={30} color="#900" />
        )
      },
    },
    ProfilePage: {
      screen: Profile,
      navigationOptions: {
        tabBarLabel:"Profile Page",
        tabBarIcon: ({ tintColor }) => …
Run Code Online (Sandbox Code Playgroud)

icons reactjs react-native react-navigation

15
推荐指数
3
解决办法
2万
查看次数

Rails 5 ActionCable 应用程序未定义

我是 Rails 5 中的 ActionCable 新手。我正在尝试为我的 Rails 应用程序进行聊天。当我尝试通过控制台发送测试消息App.room.speak('Test!')时,但当我收到错误消息时。

未捕获的 ReferenceError:应用程序未在 :1:1 处定义

房间咖啡

App.room = App.cable.subscriptions.create "RoomChannel",
  connected: ->
  # Called when the subscription is ready for use on the server

  disconnected: ->
  # Called when the subscription has been terminated by the server

  received: (data) ->
  # Called when there's incoming data on the websocket for this channel
  $('message').append data

  speak: (message)->
  @perform 'speak', message: message
Run Code Online (Sandbox Code Playgroud)

房间频道.rb

class RoomChannel < ApplicationCable::Channel
   def subscribed
     stream_from "room_channel"
   end

   def …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails ruby-on-rails-5 actioncable

5
推荐指数
1
解决办法
4171
查看次数

React-Native 检查图像 url

我正在尝试检查图像的 url 是否为 404。问题是该函数返回未定义。为什么会发生这种情况?

如果我 console.log 资源的状态,它确实显示 404,因此 if 语句正在执行。

function checkImageURL(url){
 fetch(url)
    .then(res => {
    if(res.status == 404){
      console.log(res.status)
      return <Image source={require('./Images/default.png')}/>
    }else{
      return <Image source={{uri: `${url}`}}  />
   }
 })
}
Run Code Online (Sandbox Code Playgroud)

image reactjs react-native

5
推荐指数
3
解决办法
2万
查看次数

反应 - 运行开发服务器

  • 在 react 中克隆 git 代码。
  • 安装 npm。

问题 -

由于某种原因,我无法运行 dev-server 。我在 cmd 1 上执行了这两个命令。 npm run dev-server

我得到的错误之一的“样本” -

警告:在 eslint-plugin-react 设置中未指定 React 版本。请参阅 https://github.com/yannickcr/eslint-plugin-react#configuration。C:\Users\Alon\Desktop\skillz_fontend\src\components\Inputs\GooglePlacesInput.jsx 57:30 错误缺少分号半

  1. npm 开始 -

C:\Users\Alon\Desktop\skillz_fontend>npm start npm ERR!缺少脚本:启动 npm ERR!npm 错误!你是这个意思吗?npm 错误!统计 npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!
C:\Users\Alon\AppData\Roaming\npm-cache_logs\2019-11-17T22_59_13_787Z-debug.log

谢谢阿隆

cmd npm reactjs

3
推荐指数
1
解决办法
2561
查看次数

Firebase isEmailVerified 不起作用

我正在尝试使用 firebase 中的 isEmailVerified 函数,但出现错误

user.emailVerified 不是函数

import * as firebase from 'firebase';

@IonicPage()
@Component({
  selector: 'page-login',
  templateUrl: 'login.html',
})
export class LoginPage {

  user = {} as User

  async login(user: User){
    try{
      this.afAuth.auth.signInWithEmailAndPassword(user.email,user.password)
      .then(res => {
        //check if user has made profile if not send to profile setup page
        let user = firebase.auth().currentUser;
        if(user.isEmailVerified()){
          console.log("Email is verified");
        }
     }catch(e){ 
       console.log(e);
     }
    }
  }
Run Code Online (Sandbox Code Playgroud)

email firebase typescript firebase-authentication angular

1
推荐指数
1
解决办法
1271
查看次数

VBA 在联合中选择多个列

我有下面的电子表格,在 VBA 中我想根据这些标题选择“股票代码”列和“参考价格”列。

在此输入图像描述

这是我到目前为止所尝试的,但是当我循环范围时我只能得到股票代码值。

 Dim rngRefData As Range
 Set rngRefData = Union(rdWS.Range("1:1").Find("Ticker"), rdWS.Range("1:1").Find("Reference Price"))
 Set rngRefData = Range(rngRefData, rngRefData.End(xlDown))

 For Each Item In rngRefData
      Debug.Print Item
 Next Item
Run Code Online (Sandbox Code Playgroud)

如何选择整个股票代码列的最后一个值和整个参考价格列的最后一个值。

excel vba

1
推荐指数
1
解决办法
684
查看次数