小编use*_*337的帖子

React Native - BVLinearGradient - 找不到'React/RCTViewManager.h'文件

我在iOS模拟器中运行我的React Native应用程序,我正在尝试使用BVLinearGradient.我按照github自述文件中的所有说明进行操作,但是我收到了与BVLinearGradient相关的错误.

在开发者控制台中,我看到:

警告:"BVLinearGradient"的本​​机组件不存在

当我直接从XCode运行时,我看到:

'React/RCTViewManager.h' file not found(在BVLinearGradientManager.h中) 'React/RCTView.h' file not found(在BVLinearGradient.h中)

这里发生了什么?谢谢.

ios react-native

8
推荐指数
2
解决办法
7219
查看次数

仅适用于我的EC2实例服务器上的主路由,用于适用于Laravel 4的AWS

我正在尝试在我的EC2 Instance for AWS上设置我的laravel项目.我已经使用SFTP成功将文件上传到服务器,并重写了000-default.conf文件以指向项目的公共文件夹.

本地路线装载正常,但其他路线都没有工作?知道这里发生了什么吗?它们都可以在本地主机(MAMP)和其他服务器上正常工作.

所有其他路由显示NOT FOUND页面(在此服务器上找不到请求的URL /粉丝(例如))

amazon-ec2 amazon-web-services laravel laravel-4

7
推荐指数
2
解决办法
6160
查看次数

在Web上实现Stripe:未捕获的ReferenceError:未定义StripeCheckout

我正在尝试在我的网络应用中实施Strip付款.但是,在使用示例代码时,我收到了js错误:

未捕获的ReferenceError:未定义StripeCheckout

代码是这样的:

    <script type="text/javascript" src="https://js.stripe.com/v2/"></script>

    <script>
      Stripe.setPublishableKey('pk_test_HnjFihOWwYTWnnsTLnZTmbgv');

      var handler = StripeCheckout.configure({
        key: 'pk_test_HnjFihOWwYTWnnsTLnZTmbgv',
        image: '/img/documentation/checkout/marketplace.png',
        token: function(token) {
          // Use the token to create the charge with a server-side script.
          // You can access the token ID with `token.id`
        }
      });

      $('#customButton').on('click', function(e) {
        // Open Checkout with further options
        handler.open({
          name: 'Demo Site',
          description: '2 widgets',
          amount: 2000
        });
        e.preventDefault();
      });

      // Close Checkout on page navigation
      $(window).on('popstate', function() {
        handler.close();
      });
    </script>
Run Code Online (Sandbox Code Playgroud)

知道我为什么会收到这个错误吗?谢谢.

javascript jquery stripe-payments

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

使用Javascript/React.js查找对象的数组索引

我有一个看起来像这样的数组:

var skillsets = [
  {id: 'one', name: 'george'},
  {id: 'two', name: 'greg'},
  {id: 'three', name: 'jason'},
  {id: 'four', name: 'jane'},
];
Run Code Online (Sandbox Code Playgroud)

我想要做的是根据使用Javascript以id形式给出的值来查找行.例如,如果我将"id ='two'"放入函数中,我希望将"1"作为行返回.

我知道对于单行数组,skillsets.indexOf ['value']可以工作,但这对于这个JSON集不起作用.

我怎样才能做到这一点?

编辑:

Skills = React.createClass({

    getInitialState: function() {
      return { id: 'default' };
    },

    getIndex(value, arr, prop) {
    for(var i = 0; i < arr.length; i++) {
        if(arr[i][prop] === value) {
            return i;
        }
    }
    return -1; //to handle the case where the value doesn't exist
    },

    render: function() {

        var index = getIndex(id, …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs

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

React-Native:错误:ENOENT:没有这样的文件或目录,打开'MainApplication.java'

react-native link在我的React Native项目目录中运行.

运行时我收到错误:

Error: ENOENT: no such file or directory, open '/Users/**********/f8app/android/app/src/main/java/com/facebook/f8/MainApplication.java'
Run Code Online (Sandbox Code Playgroud)

但是,此文件确实存在.

全输出:

(@):f8app *************$ react-native link
{ Error: Cannot find module '/Users/************/f8app/node_modules/moment/package.json'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at getRNPMConfig (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/core/src/config/index.js:13:10)
    at Object.getDependencyConfig (/Users/************/f8app/node_modules/react-native/local-cli/rnpm/core/src/config/index.js:38:14)
    at /Users/**************/f8app/node_modules/react-native/local-cli/rnpm/link/src/getDependencyConfig.js:11:24
    at Array.reduce (native)
    at getDependencyConfig (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/link/src/getDependencyConfig.js:8:15)
    at link (/Users/***********/f8app/node_modules/react-native/local-cli/rnpm/link/src/link.js:114:22) code: 'MODULE_NOT_FOUND' }
? What is your CodePush deployment key for Android (hit <ENTER> to ignore) 
rnpm-link info Linking react-native-code-push android dependency 
rnpm-link ERR! …
Run Code Online (Sandbox Code Playgroud)

react-native

7
推荐指数
0
解决办法
2503
查看次数

尝试在Mac OS X 10.7.5上的usr/local/bin中安装composer

我正在尝试设置作曲家,以便我可以使用Laravel框架.

我成功编辑了我的php.ini文件,并且正确安装Composer.我使用以下命令将目录更改为bin:cd /bin

然后,在bin中,我使用以下命令尝试安装Composer:

curl -sS https://getcomposer.org/installer | php -- --install-dir=bin
Run Code Online (Sandbox Code Playgroud)

但我得到以下输出:

#!/usr/bin/env php
All setting correct for using Composer
The defined install dir (bin) does not exist
Run Code Online (Sandbox Code Playgroud)

这可能是什么问题?

我使用echo $ PATH来获得以下输出:

/usr/bin:/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin
Run Code Online (Sandbox Code Playgroud)

所以似乎/ usr/local/bin确实存在.我不知所措.谢谢您的帮助.

macos composer-php

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

使用Laravel Forge进行部署问题

我正在尝试使用Laravel Forge部署Laravel PHP项目.我已正确连接到github上的我的存储库.但是,当我点击部署时,如果我去网站的公共IP,我只看到:

"No input file specified."
Run Code Online (Sandbox Code Playgroud)

在页面上.

我不知道为什么会出现这种行为.

如果我转到最新的部署日志,我会看到:

/home/forge/.forge/provision-433327.sh: line 1: cd: /home/forge/default/laravel: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
Composer could not find a composer.json file in /home/forge
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
Could not open input file: artisan
Run Code Online (Sandbox Code Playgroud)

但是,我的laravel文件夹中有一个composer.json文件....

有任何想法吗?先感谢您.

laravel-4 laravel-forge

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

使用React.js和Ajax在Laravel 5中显示验证错误

我正在运行一个Laravel 5应用程序,它的主视图使用React.js进行渲染.在页面上,我有一个简单的输入表单,我正在使用Ajax处理(在没有页面刷新的情况下发回输入).我在UserController中验证输入数据.我想要做的是在我的视图中显示错误消息(如果输入未通过验证).

我还希望根据React.js代码中的状态(提交或未提交)显示验证错误.

我如何使用React.js并且没有页面刷新?

这是一些代码:

React.js代码:

var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;

var SignupForm = React.createClass({
  getInitialState: function() {
    return {email: '', submitted: false, error: false};
  },

  _updateInputValue(e) {
    this.setState({email: e.target.value});
  },

  render: function() {
    var text = this.state.submitted ? 'Thank you!  Expect a follow up at '+email+' soon!' : 'Enter your email to request early access:';
    var style = this.state.submitted ? {"backgroundColor": "rgba(26, 188, 156, 0.4)"} : {};
    return (
      <div>
{this.state.submitted ? null :
                              <div className="overall-input">
                                  <ReactCSSTransitionGroup transitionName="example" transitionAppear={true}>
                                      <input …
Run Code Online (Sandbox Code Playgroud)

ajax reactjs laravel-5 laravel-validation

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

React.js转换不适用于"淡出"

我有一个React.js组件,我试图使用React CSS Transitions"淡出".它适用于淡入淡出,但是当我点击删除对象时,它会立即消失(而不是漂亮的淡化效果).

码:

<ReactCSSTransitionGroup 
    transitionName="example"
    transitionAppear={true}
    transitionLeave={true}
    transitionEnterTimeout={600}
    transitionAppearTimeout={600}
    transitionLeaveTimeout={300}
>
    some object
</ReactCSSTransitionGroup>
Run Code Online (Sandbox Code Playgroud)

CSS:

/ 反应过渡 /

.example-enter {
  opacity: 0.01;
  transition: opacity .5s ease-in;
}

.example-enter.example-enter-active {
  opacity: 1;
}

.example-leave {
  opacity: 1;
  transition: opacity 1s ease-in;
}

.example-leave.example-leave-active {
  opacity: 0.01;
  transition: opacity 300ms ease-in;
}

.example-appear {
  opacity: 0.01;
  transition: opacity 1s ease-in;
}

.example-appear.example-appear-active {
  opacity: 1;
}
Run Code Online (Sandbox Code Playgroud)

css css3 reactjs

6
推荐指数
2
解决办法
5405
查看次数

使用React.js重复调用react-typist

我正在使用包反应打字员来过滤并输入一些文本组件如下所示:

Typing = React.createClass({

  getInitialState: function() {
      return { textIndex: 0 };
  },

  next: function() {
    // increment the textIndex by one
    this.setState({ textIndex: this.state.textIndex + 1});
    //this.setState({visible: false});
  },

  render: function() {
    const docs = '#one';
    return (

<div>
      <div className="TypistExample">


        <Typist className="TypistExample-header" avgTypingSpeed={15000} startDelay={1000}
          onTypingDone={this.next} cursor={{show: false}}>
            <h1><a href={docs}>{typedtext[this.state.textIndex].text}</a></h1>
        </Typist>

        <p>{this.state.textIndex}</p>
        <p>{typedtext[this.state.textIndex].text}</p>

      </div>
</div>

    );
  }

});


var typedtext = [

{id: 'name', text: 'Some Name'},
{id: 'growth', text: 'Some Growth'},
{id: 'development', text: 'Some Dev'},
{id: 'analtyics', …
Run Code Online (Sandbox Code Playgroud)

reactjs

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