小编use*_*870的帖子

随机查询字符串出现在react-router中

看起来很奇怪,当我打开/时,浏览器会/#/?_k=dlo2cz在地址中显示类似的内容.每次刷新页面或切换到其他路径时,随机查询字符串值都会更改.

在此输入图像描述

代码被复制并粘贴在react-router分支上1.0.0-rc1.

import React from 'react';
import { Router, Route, Link, IndexRoute } from 'react-router';


const App = React.createClass({
  render() {
    return (
      <div>
        <h1>App</h1>
        {/* change the <a>s to <Links>s */}
        <ul>
          <li><Link to="/about">About</Link></li>
          <li><Link to="/inbox">Inbox</Link></li>
        </ul>

        {/*
          next we replace `<Child>` with `this.props.children`
          the router will figure out the children for us
        */}
        {this.props.children}
      </div>
    )
  }
});

const Message = React.createClass({
  render() {
    return <h3>Message</h3>
  }
});
const About …
Run Code Online (Sandbox Code Playgroud)

reactjs react-router

16
推荐指数
2
解决办法
5289
查看次数

如何使表单标签和字段以django-crispy-form显示在同一行上

class CustomerRegistrationForm(forms.Form):

    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.form_action = 'customer_register'


        self.helper.layout = Layout(
            HTML("""<h3>Create new customers account</h3>"""),
            Row(Field('first_name',),),
            Field('last_name',),
            Field('gender',),
            Row( Field('gender'),),
        )
Run Code Online (Sandbox Code Playgroud)

这个类的结果就像字段位于标签下面一样,但我希望有类似于https://github.com/maraujop/django-crispy-forms的例子,其中标签和字段是相同的线.

我错过了什么?

django django-forms

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

标签 统计

django ×1

django-forms ×1

react-router ×1

reactjs ×1