反应网址显示为空白

时间:2016-06-29 19:35:01

标签: reactjs react-router

我有以下反应路由器:

Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name')->nullable(false);
    $table->string('email')->unique()->nullable(false);
    $table->string('password')->nullable(false);
    $table->rememberToken();
    $table->timestamps();
});

我的网址url_base / app / accounts工作正常,但我的网址url_base / app / accounts / detail / 2显示为空白

我在路由器上做了一些修改,之后我的网址更改为url_base / accounts和url_base / accounts / detail / 2

有什么问题?嵌套路由有限制吗?

1 个答案:

答案 0 :(得分:0)

我的错误发生在调用AccountDetail组件的组件中:

<div className="account-table-td-actions-container">
    <Link className="account-table-td-actions-a" to={"/app/accounts/detail/"+ this.props.id}>
        <List svgClass="account-table-td-actions-list" width="24" height="24" />
    </Link>
    <Link className="account-table-td-actions-a" to={"/app/accounts/detail/"+ this.props.id}>                   
        <Edit svgClass="account-table-td-actions-edit" width="24" height="24" />
    </Link>
    <Link className="account-table-td-actions-a" to={"/app/accounts/detail/"+ this.props.id}>
        <Delete svgClass="account-table-td-actions-delete" width="24" height="24" />
    </Link></div>

链接错误,然后我设置了正确的网址:/ app / accounts / detail /