{"id":4562,"date":"2019-09-08T23:00:15","date_gmt":"2019-09-08T14:00:15","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=4562"},"modified":"2019-09-08T23:00:15","modified_gmt":"2019-09-08T14:00:15","slug":"vue%e3%81%a7%e3%82%bb%e3%83%ac%e3%82%af%e3%83%88%e3%83%9c%e3%83%83%e3%82%af%e3%82%b9%e3%80%81%e3%83%a9%e3%82%b8%e3%82%aa%e3%83%9c%e3%82%bf%e3%83%b3%e3%80%81%e3%83%81%e3%82%a7%e3%83%83%e3%82%af","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=4562","title":{"rendered":"Vue\u3067\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3001\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3001\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b\uff08DL\u53ef\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308d<code>USB<\/code>\u306a\u3069\u306e\u30ac\u30b8\u30a7\u30c3\u30c8\u3084\u5927\u597d\u304d\u306a<code>Laravel<\/code>\u306e\u8a71\u984c\u3070\u304b\u308a\u3067\u3001\u3053\u306e\u30d6\u30ed\u30b0\u306e\u3082\u3046\u4e00\u3064\u306e\u30e1\u30a4\u30f3\u3068\u3044\u3063\u3066\u3082\u3044\u3044<code>Vue.js<\/code>\u304b\u3089\u306f\u5c11\u3057\u9060\u3056\u304b\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u3001\u696d\u52d9\u7684\u306b<code>Vue<\/code>\u306f\u65e5\u5e38\u7684\u306b\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3053\u306e\u8fba\u3067\u307e\u305f<strong>\u300c\u3088\u308a\u6839\u672c\u7684\u306a\u4f7f\u3044\u65b9\u300d<\/strong>\u3092\u7d39\u4ecb\u3059\u308b\u305f\u3081\u306b\u3082\u4eca\u56de\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">Vue\u3067\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3001\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3001\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<p>\u3092\u7d39\u4ecb\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u3044\u3046\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u307e\u305a\u3044\u304f\u3064\u304b\u306e\u5e02\u306e\u4e2d\u304b\u3089\uff11\u3064\u3092\u9078\u3073\u307e\u3059<\/li>\n<li>\u3059\u308b\u3068\u3001\u305d\u306e\u5e02\u306b\u6240\u5c5e\u3059\u308b\u533a\u3060\u3051\u304c\u6b21\u306e\u9078\u629e\u80a2\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u308b<\/li>\n<\/ol>\n<p>\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u3064\u307e\u308a\u3001\u30a4\u30e1\u30fc\u30b8\u3067\u8a00\u3046\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4568\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/09\/coupled_inputs_1.png\" alt=\"\" width=\"420\" height=\"159\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/09\/coupled_inputs_1.png 420w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/09\/coupled_inputs_1-300x114.png 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2595 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/7.png\" alt=\"\" width=\"226\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/7.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/7-212x300.png 212w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Vue 2.6<\/p>\n<h1>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h1>\n<p>\u4eca\u56de\u306f\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3001\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3001\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\uff13\u30d1\u30bf\u30fc\u30f3\u3067\u306e\u5b9f\u88c5\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u306e\u3067\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306f\u30b3\u30fc\u30c9\u306e\u4e2d\u306b\u76f4\u63a5\u66f8\u304d\u8fbc\u307e\u305a\u3001<code>json<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066<code>axios<\/code>\u3092\u4f7f\u3063\u3066<code>Ajax<\/code>\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u4e2d\u8eab\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002\uff08\u653f\u4ee4\u6307\u5b9a\u90fd\u5e02\u3068\u305d\u306e\u4e2d\u306b\u3042\u308b\u533a\u306e\u30c7\u30fc\u30bf\u3067\u3059\uff09<br \/>\n\u30d5\u30a1\u30a4\u30eb\u540d\u306f<code>city-wards.json<\/code>\u3068\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>{<\/strong>\r\n<strong>    \"cities\": [<\/strong>\r\n<strong>        {\"id\": 1, \"name\": \"\u672d\u5e4c\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 2, \"name\": \"\u4ed9\u53f0\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 3, \"name\": \"\u3055\u3044\u305f\u307e\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 4, \"name\": \"\u5343\u8449\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 5, \"name\": \"\u6a2a\u6d5c\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 6, \"name\": \"\u5ddd\u5d0e\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 7, \"name\": \"\u76f8\u6a21\u539f\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 8, \"name\": \"\u65b0\u6f5f\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 9, \"name\": \"\u9759\u5ca1\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 10, \"name\": \"\u6d5c\u677e\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 11, \"name\": \"\u540d\u53e4\u5c4b\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 12, \"name\": \"\u4eac\u90fd\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 13, \"name\": \"\u5927\u962a\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 14, \"name\": \"\u583a\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 15, \"name\": \"\u795e\u6238\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 16, \"name\": \"\u5ca1\u5c71\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 17, \"name\": \"\u5e83\u5cf6\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 18, \"name\": \"\u5317\u4e5d\u5dde\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 19, \"name\": \"\u798f\u5ca1\u5e02\"},<\/strong>\r\n<strong>        {\"id\": 20, \"name\": \"\u718a\u672c\u5e02\"}<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>    \"wards\": [<\/strong>\r\n\r\n<strong>        {\"cityId\": 1, \"id\": 1, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 2, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 3, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 4, \"name\": \"\u767d\u77f3\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 5, \"name\": \"\u8c4a\u5e73\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 6, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 7, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 8, \"name\": \"\u539a\u5225\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 9, \"name\": \"\u624b\u7a32\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 1, \"id\": 10, \"name\": \"\u6e05\u7530\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 2, \"id\": 1, \"name\": \"\u9752\u8449\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 2, \"id\": 2, \"name\": \"\u5bae\u57ce\u91ce\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 2, \"id\": 3, \"name\": \"\u82e5\u6797\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 2, \"id\": 4, \"name\": \"\u592a\u767d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 2, \"id\": 5, \"name\": \"\u6cc9\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 3, \"id\": 1, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 2, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 3, \"name\": \"\u5927\u5bae\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 4, \"name\": \"\u898b\u6cbc\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 5, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 6, \"name\": \"\u685c\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 7, \"name\": \"\u6d66\u548c\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 8, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 9, \"name\": \"\u7dd1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 3, \"id\": 10, \"name\": \"\u5ca9\u69fb\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 4, \"id\": 1, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 4, \"id\": 2, \"name\": \"\u82b1\u898b\u5ddd\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 4, \"id\": 3, \"name\": \"\u7a32\u6bdb\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 4, \"id\": 4, \"name\": \"\u82e5\u8449\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 4, \"id\": 5, \"name\": \"\u7dd1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 4, \"id\": 6, \"name\": \"\u7f8e\u6d5c\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 5, \"id\": 1, \"name\": \"\u9db4\u898b\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 2, \"name\": \"\u795e\u5948\u5ddd\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 3, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 4, \"name\": \"\u4e2d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 5, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 6, \"name\": \"\u4fdd\u571f\u30f6\u8c37\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 7, \"name\": \"\u78ef\u5b50\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 8, \"name\": \"\u91d1\u6ca2\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 9, \"name\": \"\u6e2f\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 10, \"name\": \"\u6238\u585a\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 11, \"name\": \"\u6e2f\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 12, \"name\": \"\u65ed\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 13, \"name\": \"\u7dd1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 14, \"name\": \"\u702c\u8c37\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 15, \"name\": \"\u6804\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 16, \"name\": \"\u6cc9\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 17, \"name\": \"\u9752\u8449\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 5, \"id\": 18, \"name\": \"\u90fd\u7b51\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 6, \"id\": 1, \"name\": \"\u5ddd\u5d0e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 6, \"id\": 2, \"name\": \"\u5e78\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 6, \"id\": 3, \"name\": \"\u4e2d\u539f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 6, \"id\": 4, \"name\": \"\u9ad8\u6d25\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 6, \"id\": 5, \"name\": \"\u591a\u6469\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 6, \"id\": 6, \"name\": \"\u5bae\u524d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 6, \"id\": 7, \"name\": \"\u9ebb\u751f\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 7, \"id\": 1, \"name\": \"\u7dd1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 7, \"id\": 2, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 7, \"id\": 3, \"name\": \"\u5357\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 8, \"id\": 1, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 2, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 3, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 4, \"name\": \"\u6c5f\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 5, \"name\": \"\u79cb\u8449\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 6, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 7, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 8, \"id\": 8, \"name\": \"\u897f\u84b2\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 9, \"id\": 1, \"name\": \"\u8475\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 9, \"id\": 2, \"name\": \"\u99ff\u6cb3\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 9, \"id\": 3, \"name\": \"\u6e05\u6c34\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 10, \"id\": 1, \"name\": \"\u4e2d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 10, \"id\": 2, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 10, \"id\": 3, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 10, \"id\": 4, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 10, \"id\": 5, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 10, \"id\": 6, \"name\": \"\u6d5c\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 10, \"id\": 7, \"name\": \"\u5929\u7adc\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 11, \"id\": 1, \"name\": \"\u5343\u7a2e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 2, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 3, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 4, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 5, \"name\": \"\u4e2d\u6751\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 6, \"name\": \"\u4e2d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 7, \"name\": \"\u662d\u548c\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 8, \"name\": \"\u745e\u7a42\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 9, \"name\": \"\u71b1\u7530\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 10, \"name\": \"\u4e2d\u5ddd\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 11, \"name\": \"\u6e2f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 12, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 13, \"name\": \"\u5b88\u5c71\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 14, \"name\": \"\u7dd1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 15, \"name\": \"\u540d\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 11, \"id\": 16, \"name\": \"\u5929\u767d\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 12, \"id\": 1, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 2, \"name\": \"\u4e0a\u4eac\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 3, \"name\": \"\u5de6\u4eac\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 4, \"name\": \"\u4e2d\u4eac\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 5, \"name\": \"\u6771\u5c71\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 6, \"name\": \"\u4e0b\u4eac\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 7, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 8, \"name\": \"\u53f3\u4eac\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 9, \"name\": \"\u4f0f\u898b\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 10, \"name\": \"\u5c71\u79d1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 12, \"id\": 11, \"name\": \"\u897f\u4eac\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 13, \"id\": 1, \"name\": \"\u90fd\u5cf6\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 2, \"name\": \"\u798f\u5cf6\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 3, \"name\": \"\u6b64\u82b1\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 4, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 5, \"name\": \"\u6e2f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 6, \"name\": \"\u5927\u6b63\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 7, \"name\": \"\u5929\u738b\u5bfa\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 8, \"name\": \"\u6d6a\u901f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 9, \"name\": \"\u897f\u6dc0\u5ddd\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 10, \"name\": \"\u6771\u6dc0\u5ddd\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 11, \"name\": \"\u6771\u6210\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 12, \"name\": \"\u751f\u91ce\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 13, \"name\": \"\u65ed\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 14, \"name\": \"\u57ce\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 15, \"name\": \"\u963f\u500d\u91ce\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 16, \"name\": \"\u4f4f\u5409\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 17, \"name\": \"\u6771\u4f4f\u5409\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 18, \"name\": \"\u897f\u6210\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 19, \"name\": \"\u6dc0\u5ddd\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 20, \"name\": \"\u9db4\u898b\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 21, \"name\": \"\u4f4f\u4e4b\u6c5f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 22, \"name\": \"\u5e73\u91ce\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 23, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 13, \"id\": 24, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 14, \"id\": 1, \"name\": \"\u583a\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 14, \"id\": 2, \"name\": \"\u4e2d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 14, \"id\": 3, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 14, \"id\": 4, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 14, \"id\": 5, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 14, \"id\": 6, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 14, \"id\": 7, \"name\": \"\u7f8e\u539f\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 15, \"id\": 1, \"name\": \"\u6771\u7058\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 2, \"name\": \"\u7058\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 3, \"name\": \"\u5175\u5eab\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 4, \"name\": \"\u9577\u7530\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 5, \"name\": \"\u9808\u78e8\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 6, \"name\": \"\u5782\u6c34\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 7, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 8, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 15, \"id\": 9, \"name\": \"\u897f\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 16, \"id\": 1, \"name\": \"\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 16, \"id\": 2, \"name\": \"\u4e2d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 16, \"id\": 3, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 16, \"id\": 4, \"name\": \"\u5357\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 17, \"id\": 1, \"name\": \"\u4e2d\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 2, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 3, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 4, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 5, \"name\": \"\u5b89\u4f50\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 6, \"name\": \"\u5b89\u4f50\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 7, \"name\": \"\u5b89\u82b8\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 17, \"id\": 8, \"name\": \"\u4f50\u4f2f\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 18, \"id\": 1, \"name\": \"\u9580\u53f8\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 18, \"id\": 2, \"name\": \"\u82e5\u677e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 18, \"id\": 3, \"name\": \"\u6238\u7551\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 18, \"id\": 4, \"name\": \"\u5c0f\u5009\u5317\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 18, \"id\": 5, \"name\": \"\u5c0f\u5009\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 18, \"id\": 6, \"name\": \"\u516b\u5e61\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 18, \"id\": 7, \"name\": \"\u516b\u5e61\u897f\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 19, \"id\": 1, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 19, \"id\": 2, \"name\": \"\u535a\u591a\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 19, \"id\": 3, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 19, \"id\": 4, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 19, \"id\": 5, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 19, \"id\": 6, \"name\": \"\u57ce\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 19, \"id\": 7, \"name\": \"\u65e9\u826f\u533a\"},<\/strong>\r\n\r\n<strong>        {\"cityId\": 20, \"id\": 1, \"name\": \"\u4e2d\u592e\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 20, \"id\": 2, \"name\": \"\u6771\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 20, \"id\": 3, \"name\": \"\u897f\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 20, \"id\": 4, \"name\": \"\u5357\u533a\"},<\/strong>\r\n<strong>        {\"cityId\": 20, \"id\": 5, \"name\": \"\u5317\u533a\"}<\/strong>\r\n<strong>    ]<\/strong>\r\n<strong>}<\/strong><\/pre>\n<h1>Vue\u3067\u9078\u629e\u5165\u529b\u3092\u9023\u52d5\u3055\u305b\u308b<\/h1>\n<h2>\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b<\/h2>\n<p>\u307e\u305a\u306f\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u30dc\u30c3\u30af\u30b9\u306e\u9023\u52d5\u3067\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9&lt;\/h1&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        &lt;h5&gt;\u3010\u5e02\u3011&lt;\/h5&gt;\r\n        <strong>&lt;select name=\"city_id\" v-model=\"selectedCityId\" @change=\"onChangeCity\"&gt;<\/strong>\r\n<strong>            &lt;option&gt;&lt;\/option&gt;<\/strong>\r\n<strong>            &lt;option v-for=\"city in cities\" :value=\"city.id\" v-text=\"city.name\"&gt;&lt;\/option&gt;<\/strong>\r\n<strong>        &lt;\/select&gt;<\/strong>\r\n        &lt;h5&gt;\u3010\u533a\u3011&lt;\/h5&gt;\r\n        <strong>&lt;select name=\"ward_id\" v-model=\"selectedWardId\"&gt;<\/strong>\r\n<strong>            &lt;option&gt;&lt;\/option&gt;<\/strong>\r\n<strong>            &lt;option v-for=\"ward in filteredWards\" :value=\"ward.id\" v-text=\"ward.name\"&gt;&lt;\/option&gt;<\/strong>\r\n<strong>        &lt;\/select&gt;<\/strong>\r\n        &lt;hr&gt;\r\n        &lt;div&gt;\r\n            &lt;h5&gt;\u3010\u9078\u629e\u3055\u308c\u305f\u5024\u3011&lt;\/h5&gt;\r\n            \u5e02: &lt;strong v-text=\"selectedCityId\"&gt;&lt;\/strong&gt;&lt;br&gt;\r\n            \u533a: &lt;strong v-text=\"selectedWardId\"&gt;&lt;\/strong&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.10\/dist\/vue.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.0\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                cities: [],\r\n                wards: [],\r\n                selectedCityId: -1,\r\n                selectedWardId: -1\r\n            },\r\n            methods: {\r\n                onChangeCity() {\r\n\r\n                    this.selectedWardId = -1;\r\n\r\n                    if(!this.selectedCityId) {\r\n\r\n                        this.selectedCityId = -1;\r\n\r\n                    }\r\n\r\n                }\r\n            },\r\n            computed: {\r\n                <strong>filteredWards() {<\/strong>\r\n\r\n<strong>                    let filteredWards = [];<\/strong>\r\n\r\n<strong>                    for(let i = 0 ; i &lt; this.wards.length ; i++) {<\/strong>\r\n\r\n<strong>                        let ward = this.wards[i];<\/strong>\r\n\r\n<strong>                        if(ward.cityId == this.selectedCityId) {<\/strong>\r\n\r\n<strong>                            filteredWards.push(ward);<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    return filteredWards;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n            },\r\n            <strong>mounted() {<\/strong>\r\n\r\n<strong>                axios.get('\/json\/city-wards.json')<\/strong>\r\n<strong>                    .then((response) =&gt; {<\/strong>\r\n\r\n<strong>                        this.cities = response.data.cities;<\/strong>\r\n<strong>                        this.wards = response.data.wards;<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u307e\u305a<code>mounted()<\/code>\u3067\u30da\u30fc\u30b8\u8aad\u307f\u8fbc\u307f\u3068\u540c\u6642\u306b\u5148\u307b\u3069\u306e<code>json<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002\uff08\u3053\u308c\u306f\u305d\u306e\u4ed6\u306e\u5834\u5408\u3082\u540c\u3058\u3067\u3059\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u4e2d\u3067\u4e00\u756a\u91cd\u8981\u306a\u306e\u304c<code>computed<\/code>\u5185\u306e<code>filteredWards()<\/code>\u3067\u3059\u3002<\/p>\n<p><code>Vue<\/code>\u306e<code>computed<\/code>\u306f\u3001<strong>\u300c\u4f55\u304b\u30c7\u30fc\u30bf\u306b\u5909\u66f4\u304c\u3042\u3063\u305f\u3089\u81ea\u52d5\u7684\u306b\u518d\u8a08\u7b97\u3059\u308b\u300d<\/strong>\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3001<code>filteredWards<\/code>\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u3042\u305f\u304b\u3082\u5909\u6570\u3067\u3042\u308b\u304b\u306e\u3088\u3046\u306b\u4f7f\u3046\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u5b9f\u969b\u306b\u306f\u4ee5\u4e0b\u306e\u90e8\u5206\u306b\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>&lt;option <strong>v-for=\"ward in filteredWards\"<\/strong> :value=\"ward.id\" v-text=\"ward.name\"&gt;&lt;\/option&gt;<\/pre>\n<p>\u3064\u307e\u308a\u3001\u5e02\u306e\u30c7\u30fc\u30bf\u3067\u3042\u308b<code>selectedCityId<\/code>\u306b\u5909\u5316\u304c\u3042\u308b\u3068\u3001\u533a\u306e\u9078\u629e\u80a2\u3067\u3042\u308b<code>filteredWards<\/code>\u304c\u81ea\u52d5\u7684\u306b\u5909\u66f4\u306b\u306a\u3063\u3066\u304f\u308c\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u306f\u3001\u4eca\u56de\u306f\uff13\u30d1\u30bf\u30fc\u30f3\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3072\u3068\u3064\u305a\u3064\u30c6\u30b9\u30c8\u7d50\u679c\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u2193\u2193\u2193<\/p>\n<p><strong>\u3010Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u30b5\u30f3\u30d7\u30eb\u3011<\/strong><\/p>\n<p><iframe loading=\"lazy\" title=\"Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/3reaxVwL8X4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3092\u9023\u52d5\u3055\u305b\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306e\u9023\u52d5\u3067\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3&lt;\/h1&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        &lt;h5&gt;\u3010\u5e02\u3011&lt;\/h5&gt;\r\n        <strong>&lt;label v-for=\"city in cities\"&gt;<\/strong>\r\n<strong>            &lt;input type=\"radio\" :value=\"city.id\" v-model=\"selectedCityId\" @change=\"onChangeCity\"&gt;<\/strong>\r\n<strong>            &lt;span v-text=\"city.name\"&gt;&lt;\/span&gt;<\/strong>\r\n<strong>            &amp;nbsp;<\/strong>\r\n<strong>        &lt;\/label&gt;<\/strong>\r\n        &lt;h5&gt;\u3010\u533a\u3011&lt;\/h5&gt;\r\n        <strong>&lt;label v-for=\"ward in filteredWards\"&gt;<\/strong>\r\n<strong>            &lt;input type=\"radio\" :value=\"ward.id\" v-model=\"selectedWardId\"&gt;<\/strong>\r\n<strong>            &lt;span v-text=\"ward.name\"&gt;&lt;\/span&gt;<\/strong>\r\n<strong>            &amp;nbsp;<\/strong>\r\n<strong>        &lt;\/label&gt;<\/strong>\r\n        &lt;hr&gt;\r\n        &lt;div&gt;\r\n            &lt;h5&gt;\u3010\u9078\u629e\u3055\u308c\u305f\u5024\u3011&lt;\/h5&gt;\r\n            \u5e02: &lt;strong v-text=\"selectedCityId\"&gt;&lt;\/strong&gt;&lt;br&gt;\r\n            \u533a: &lt;strong v-text=\"selectedWardId\"&gt;&lt;\/strong&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.10\/dist\/vue.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.0\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                cities: [],\r\n                wards: [],\r\n                selectedCityId: -1,\r\n                selectedWardId: -1\r\n            },\r\n            methods: {\r\n                onChangeCity() {\r\n\r\n                    this.selectedWardId = -1;\r\n\r\n                    if(!this.selectedCityId) {\r\n\r\n                        this.selectedCityId = -1;\r\n\r\n                    }\r\n\r\n                }\r\n            },\r\n            computed: {\r\n                filteredWards() {\r\n\r\n                    let filteredWards = [];\r\n\r\n                    for(let i = 0 ; i &lt; this.wards.length ; i++) {\r\n\r\n                        let ward = this.wards[i];\r\n\r\n                        if(ward.cityId == this.selectedCityId) {\r\n\r\n                            filteredWards.push(ward);\r\n\r\n                        }\r\n\r\n                    }\r\n\r\n                    return filteredWards;\r\n\r\n                }\r\n            },\r\n            mounted() {\r\n\r\n                axios.get('\/json\/city-wards.json')\r\n                    .then((response) =&gt; {\r\n\r\n                        this.cities = response.data.cities;\r\n                        this.wards = response.data.wards;\r\n\r\n                    });\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306f\u5148\u307b\u3069\u306e\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3068\u307b\u307c\u540c\u3058\u30b3\u30fc\u30c9\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u8a73\u3057\u3044\u5185\u5bb9\u306f\u4e0a\u306e\u9805\u76ee\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u3061\u3089\u3082\u30c6\u30b9\u30c8\u7d50\u679c\u3067\u3059\u3002<\/p>\n<p>\u2193\u2193\u2193<\/p>\n<p><strong>\u3010Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u306e\u30b5\u30f3\u30d7\u30eb\u3011<\/strong><\/p>\n<p><iframe loading=\"lazy\" title=\"Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/tE60AU-DkJM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b<\/h2>\n<p>\u3067\u306f\u6700\u5f8c\u306b\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    &lt;h1&gt;Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9&lt;\/h1&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        &lt;h5&gt;\u3010\u5e02\u3011&lt;\/h5&gt;\r\n        <strong>&lt;label v-for=\"city in cities\"&gt;<\/strong>\r\n<strong>            &lt;input type=\"checkbox\" :value=\"city.id\" v-model=\"selectedCityIds\" @change=\"onChangeCity\"&gt;<\/strong>\r\n<strong>            &lt;span v-text=\"city.name\"&gt;&lt;\/span&gt;<\/strong>\r\n<strong>            &amp;nbsp;<\/strong>\r\n<strong>        &lt;\/label&gt;<\/strong>\r\n        &lt;h5&gt;\u3010\u533a\u3011&lt;\/h5&gt;\r\n        <strong>&lt;label v-for=\"ward in filteredWards\"&gt;<\/strong>\r\n<strong>            &lt;input type=\"checkbox\" :value=\"ward.id\" v-model=\"selectedWardIds\"&gt;<\/strong>\r\n<strong>            &lt;span v-text=\"ward.name\"&gt;&lt;\/span&gt;<\/strong>\r\n<strong>            &amp;nbsp;&amp;nbsp;<\/strong>\r\n<strong>        &lt;\/label&gt;<\/strong>\r\n        &lt;hr&gt;\r\n        &lt;div&gt;\r\n            &lt;h5&gt;\u3010\u9078\u629e\u3055\u308c\u305f\u5024\u3011&lt;\/h5&gt;\r\n            \u5e02: &lt;strong v-text=\"selectedCityIds\"&gt;&lt;\/strong&gt;&lt;br&gt;\r\n            \u533a: &lt;strong v-text=\"selectedWardIds\"&gt;&lt;\/strong&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.10\/dist\/vue.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.0\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                cities: [],\r\n                wards: [],\r\n                <strong>selectedCityIds: [],<\/strong>\r\n<strong>                selectedWardIds: []<\/strong>\r\n            },\r\n            methods: {\r\n                onChangeCity() {\r\n\r\n                    this.selectedWardIds = [];\r\n\r\n                    if(!this.selectedCityIds) {\r\n\r\n                        this.selectedCityIds = [];\r\n\r\n                    }\r\n\r\n                }\r\n            },\r\n            computed: {\r\n                <strong>filteredWards() {<\/strong>\r\n\r\n<strong>                    let filteredWards = [];<\/strong>\r\n\r\n<strong>                    for(let i = 0 ; i &lt; this.wards.length ; i++) {<\/strong>\r\n\r\n<strong>                        let ward = this.wards[i];<\/strong>\r\n\r\n<strong>                        if(this.selectedCityIds.includes(ward.cityId)) {<\/strong>\r\n\r\n<strong>                            let city = this.cities.find((city) =&gt; {<\/strong>\r\n\r\n<strong>                                return (city.id == ward.cityId);<\/strong>\r\n\r\n<strong>                            });<\/strong>\r\n\r\n<strong>                            let id = city.id +'-'+ ward.id;<\/strong>\r\n<strong>                            let name = city.name + ward.name;<\/strong>\r\n<strong>                            filteredWards.push({<\/strong>\r\n<strong>                                id: id,<\/strong>\r\n<strong>                                name: name<\/strong>\r\n<strong>                            });<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    return filteredWards;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n            },\r\n            mounted() {\r\n\r\n                axios.get('\/json\/city-wards.json')\r\n                    .then((response) =&gt; {\r\n\r\n                        this.cities = response.data.cities;\r\n                        this.wards = response.data.wards;\r\n\r\n                    });\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u5834\u5408\u3082\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3084\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3068\u69cb\u9020\u7684\u306b\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u91cd\u8981\u306a\u306e\u306f<strong>\u300c\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u5834\u5408\u306f\u9078\u629e\u304c\u8907\u6570\u306b\u306a\u308b\u300d<\/strong>\u3068\u3044\u3046\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u9078\u629e\u3055\u308c\u305f\u5e02\u3068\u533a\u306e\u5909\u6570\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8907\u6570\u5f62\u306b\u5909\u66f4\u3057\u3001\u914d\u5217\u3067\u30c7\u30fc\u30bf\u304c\u5165\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>selectedCityIds<\/li>\n<li>selectedWardIds<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001\u3053\u308c\u306b\u4f34\u3063\u3066<code>filteredWards()<\/code>\u3082<strong>\u300c\u30c1\u30a7\u30c3\u30af\u304c\u5165\u3063\u3066\u3044\u308b\u5e02\u306b\u6240\u5c5e\u3059\u308b\u533a\u3059\u3079\u3066\u300d<\/strong>\u3092\u62bd\u51fa\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306e\u30c6\u30b9\u30c8\u7d50\u679c\u3067\u3059\u3002<\/p>\n<p>\u2193\u2193\u2193<\/p>\n<p><strong>\u3010Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306e\u30b5\u30f3\u30d7\u30eb\u3011<\/strong><\/p>\n<p><iframe loading=\"lazy\" title=\"Vue\u3092\u4f7f\u3063\u3066\u9023\u52d5\u3059\u308b\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/Wpk4eqWRs14?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h1>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u203b \u305f\u3060\u3057\u3001Ajax\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u306e\u3067\u30d5\u30a1\u30a4\u30eb\u5358\u4f53\u3067\u306f\u52d5\u304d\u307e\u305b\u3093\u3002\u5fc5\u305a\u30a6\u30a7\u30d6\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=4569&amp;tmstv=1777539738\" rel=\"nofollow\" id=\"download-link-4569\" data-redirect=\"false\" >\n\tVue\u3067\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3001\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3001\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b<\/a>\n\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4e45\u3057\u3076\u308a\u306b<code>Vue<\/code>\u3092\u4f7f\u3063\u3066\u9078\u629e\u80a2\u3092\u9023\u52d5\u3055\u305b\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56de\u5b9f\u88c5\u3057\u305f\u5185\u5bb9\u306f\u5b9f\u969b\u306b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u69d8\u304b\u3089\u3054\u8981\u671b\u3068\u3057\u3066\u3082\u3054\u4f9d\u983c\u3044\u305f\u3060\u3044\u305f\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u4f7f\u3046\u5074\u304b\u3089\u3059\u308b\u3068\u304b\u306a\u308a\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u304c\u9ad8\u304f\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002\u7279\u306b\u305f\u304f\u3055\u3093\u306e\u767b\u9332\u3092\u3059\u308b\u5834\u5408\u306f\u9078\u629e\u80a2\u306b\u30d5\u30a3\u30eb\u30bf\u30fc\u304c\u304b\u304b\u308b\u3060\u3051\u3067\u4f5c\u696d\u304c\u65e9\u304f\u306a\u308a\u307e\u3059\u3057\u3001\u307e\u305f\u3001\u9593\u9055\u3044\u3082\u6e1b\u3089\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306b\u306f\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-428 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/30.png\" alt=\"\" width=\"205\" height=\"350\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/30.png 205w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/30-176x300.png 176w\" sizes=\"auto, (max-width: 205px) 100vw, 205px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dUSB\u306a\u3069\u306e\u30ac\u30b8\u30a7\u30c3\u30c8\u3084\u5927\u597d\u304d\u306aLaravel\u306e\u8a71\u984c\u3070\u304b\u308a\u3067\u3001\u3053\u306e\u30d6\u30ed\u30b0\u306e\u3082\u3046\u4e00\u3064\u306e\u30e1\u30a4\u30f3\u3068\u3044\u3063\u3066\u3082\u3044\u3044Vue.js\u304b\u3089\u306f\u5c11\u3057\u9060\u3056\u304b\u3063\u3066\u3057 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=4562\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Vue\u3067\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3001\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3\u3001\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3059\u308b\uff08DL\u53ef\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":4574,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,97],"tags":[],"class_list":["post-4562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vue-js","category-97"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4562"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4562\/revisions"}],"predecessor-version":[{"id":4575,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4562\/revisions\/4575"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/4574"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}