<form onsubmit="func()">
<h1>Регистрация</h1>
<p>
Введите логин:<br>
<input type="text" id="login">
<br>
Введите пароль<br>
<input type="password" id="password">
<br>
<input type="submit">
</p>
</form>
<script>
const func = e => {
console.log({
"login": document.getElementById('login').value,
"password": document.getElementById('password').value,
})
}
</script>
function getUserAccount() {
return axios.get('/user/12345');
}
function getUserPermissions() {
return axios.get('/user/12345/permissions');
}
axios.all([getUserAccount(), getUserPermissions()])
.then(axios.spread(function (acct, perms) {
// Both requests are now complete
}));
this.props.data.map((item, index) => {
let class = '';
if(index === 0) {
class='first'
}
if(index === this.props.data.length-1) {
class='second'
}
console.log('item', item);
return (
<div key={item.id} className={class}>
{item.title}
{item.round.map((r) => {
console.log('r', r);
return (
<div key={r.id}>
{r.total}
</div>
)
})}
</div>
)
})
import React from 'react'
export default data => (
<div>
data.map((item, index) => {
let class = '';
if(index === 0) {
class='first'
}
if(index === this.props.data.length-1) {
class='second'
}
return (
<div key={item.id} className={class}>
{item.title}
{item.round.map(r => (
<div key={r.id}>
{r.total}
</div>
) )}
</div>
)
})
</div>
)
word-wrap: break-word;