а на Vue можно постепенно внедрять блоки?
var test = document.getElementById("test").value
import React from 'react';
import $ from 'jquery';
class App extends React.Component {
render() {
return (
<div>
<Header/>
<Content/>
</div>
);
}
}
class Header extends React.Component {
render() {
return (
<div>
<h1>Title</h1>
</div>
);
}
}
class Content extends React.Component {
constructor() {
super()
this.state = {
data: []
}
}
componentDidMount() {
$.ajax({
url: "http://jsonplaceholder.typicode.com/users",
type: "GET",
dataType: 'json',
ContentType: 'application/json',
success: function (data) {
this.setState({data: data});
}.bind(this),
error: function (jqXHR) {
console.log(jqXHR);
}.bind(this)
})
}
render() {
return (
<table>
<tbody>{this.state.data.map(function (item, key) {
return (
<tr key={key}>
<td>{item.name}</td>
<td>{item.email}</td>
</tr>
)
})}</tbody>
</table>
)
}
}
export default App;