{"id":6039,"date":"2020-08-16T10:38:16","date_gmt":"2020-08-16T01:38:16","guid":{"rendered":"https:\/\/nsme.red\/wp\/?p=6039"},"modified":"2020-08-16T23:57:35","modified_gmt":"2020-08-16T14:57:35","slug":"v-for-%e3%83%aa%e3%82%b9%e3%83%88%e3%83%ac%e3%83%b3%e3%83%80%e3%83%aa%e3%83%b3%e3%82%b0","status":"publish","type":"post","link":"https:\/\/core.nsme.net\/notes\/vue-js\/6039\/","title":{"rendered":"v-for \u30ea\u30b9\u30c8\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u57fa\u672c\u306e\u4f7f\u3044\u65b9\n&lt;tr v-for=\"staff in filteredData\">\n\n&lt;\/tr>\u3000<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\uff49\uff4e\uff44\uff45\uff58\u306e\u3042\u308b\u5834\u5408\uff08\u7b2c\u4e8c\u5f15\u6570\u306bindex\u3092\u6307\u5b9a\uff09\n&lt;span v-for=\"(val, index) in staff.roles\">{{index}} &lt;\/span><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5834\u5408\u306f\u30ad\u30fc\u3082\u8868\u793a\u3067\u304d\u308b\n&lt;li v-for=\"(value, key , index) in sampleObject\">&#91;{{index}}]:\uff08{{key}}\uff09{{value}}&lt;\/li><\/code><\/pre>\n\n\n\n<p>v-for\u306e\u4e2d\u306e\u30dc\u30bf\u30f3\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u305f\u3044\u5834\u5408<br>val in lists \u306eval\u3092\u5f15\u6570\u3068\u3057\u3066\u4e0e\u3048\u308b\u306e\u304c\u7c21\u5358\u3002<br><br>\u8907\u6570\u306e\u5024\u3092\u4e0e\u3048\u308b\u5834\u5408\u3001\u5f15\u6570\u306b\u914d\u5217\u3092\u6e21\u3057\u3066\u3082\u3044\u3044\u304c\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092JSON\u5f62\u5f0f\u3067\u6e21\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;tr v-for=\"car in daburiCar\">\ntd>{{car.syaken}}&lt;\/td>\n\t&lt;td>{{car.in_use}}&lt;\/td>\n\t&lt;td>\t\n\t\t&lt;button v-for=\"tenken in car.tenken\" @click=\"editTenkencar(\n\t\t{plate: car.num_plate, syaken: car.syaken, tenken: tenken})\">{{tenken.tenken}}&lt;\/button>\t\t\n\t&lt;\/td>\n&lt;\/tr>\n\nJS\nmethods\n\teditTenkencar : function(data){\n\t\tthis.editTenken = data;\n\t}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>v-for\u306e\u4e2d\u306e\u30dc\u30bf\u30f3\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u305f\u3044\u5834\u5408val in lists \u306eval\u3092\u5f15\u6570\u3068\u3057\u3066\u4e0e\u3048\u308b\u306e\u304c\u7c21\u5358\u3002 \u8907\u6570\u306e\u5024\u3092\u4e0e\u3048\u308b\u5834\u5408\u3001\u5f15\u6570\u306b\u914d\u5217\u3092\u6e21\u3057\u3066\u3082\u3044\u3044\u304c\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092JSON\u5f62\u5f0f\u3067\u6e21\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[13,41],"tags":[],"class_list":["post-6039","post","type-post","status-publish","format-standard","hentry","category-vue-js","category-41"],"acf":[],"_links":{"self":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/comments?post=6039"}],"version-history":[{"count":3,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6039\/revisions"}],"predecessor-version":[{"id":6046,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6039\/revisions\/6046"}],"wp:attachment":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/media?parent=6039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/categories?post=6039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/tags?post=6039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}