循环通过json reactJS

时间:2016-08-08 16:37:57

标签: json reactjs

我喜欢循环显示第一级值的json文件作为链接:

.intro {
  display: none;
}
.intro:first-child {display: block;}
.next { 
    display: none; 
    padding: .5em;
    margin: .5em;
    background: #FF9800;
    border-radius: 30px;
}

JSON

<input id="name" type="text" class="intro" placeholder="name">
<input id="email" type="email" class="intro" placeholder="email">
<input id="title" type="text" class="intro" placeholder="title">


<a class="next" id="next">show div</a>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

JS

  <Route path='/acordes' component={Acordes}>
    <IndexRoute component={La} />
    <Route path='laSib' component={LaSib} />
    <Route path='query' component={Query} />
  </Route>

然后,当用户点击{la}时,它应该从json显示它的内容。

0 个答案:

没有答案