問321
イベントデリゲーションに関して。 こちらのDOMの
<ul id="todo-app">
<li class="item">Walk the dog</li>
<li class="item">Pay bills</li>
<li class="item">Make dinner</li>| const arr = [1, 2, 3, 4, 6] | |
| const arr2 = [1, 2, 3, 4, 5] | |
| const arr3 = [...arr, ...arr2] | |
| const a = [] | |
| for (let [i, e] of arr3.entries()) { | |
| if(!arr.includes(e)) a.push(e) | |
| if(!arr2.includes(e)) a.push(e) | |
| } | |
| console.log(a) |
| ///webpack.config.js変更前///// | |
| module: { | |
| loaders: [ | |
| { test: /\.jsx?$/, exclude: /node_modules/, | |
| loaders: ['react-hot'] | |
| } | |
| ] | |
| }, | |
| ///変更後//// |
| function renderToElements(elements) { | |
| Array.prototype.slice.call(elements).forEach(function(e, i){ | |
| React.render(<FavoriteFortune id={e.dataset.id} isFavorite={true} />, e); | |
| }) | |
| } | |
| renderToElements(document.getElementsByClassName('favoriteFortune')); |
| { | |
| "comments": [ | |
| { | |
| "body": "some comment", | |
| "id": 1, | |
| "postId": 1 | |
| } | |
| ], | |
| "posts": [ | |
| { |
| <properties> | |
| <property name="eclipselink.jdbc.user" value="APP"/> | |
| <property name="eclipselink.jdbc.password" value="APP"/> | |
| </properties> | |
| @Entity | |
| @SecondaryTables({ | |
| @SecondaryTable(name = "zipcode_tbl"),//not much!! | |
| @SecondaryTable(name = "address_tbl"), | |
| }) | |
| @Table(name="user_data_2") | |
| public class UserEntity02 implements Serializable { | |
| @Id @NotNull | |
| private String id; | |
| private String name; |
| <properties> | |
| <!--add this code, if you use eclipselink --> | |
| <property name="eclipselink.ddl-generation" value="create-tables"/> |
| sudo /usr/local/lib/rustlib/uninstall.sh |
| class ParentComponent extends React.Component { | |
| constructor(props){ | |
| super(props) | |
| this.state = { | |
| name: "わたし" | |
| }; | |
| this.onChangeName = this.onChangeName.bind(this); | |
| } | |
| onChangeName(){ | |
| const name = this.state.name === "あなた" ? "わたし" : "あなた"; |
問321
イベントデリゲーションに関して。 こちらのDOMの
<ul id="todo-app">
<li class="item">Walk the dog</li>
<li class="item">Pay bills</li>
<li class="item">Make dinner</li>