{"id":2851,"date":"2018-12-12T06:43:08","date_gmt":"2018-12-11T21:43:08","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2851"},"modified":"2020-04-08T06:17:23","modified_gmt":"2020-04-07T21:17:23","slug":"%e3%81%99%e3%81%90%e3%81%a7%e3%81%8d%e3%82%8b%ef%bc%81vue%e3%81%a7%e2%97%8bx%e3%82%b2%e3%83%bc%e3%83%a0%e3%82%92%e3%81%a4%e3%81%8f%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2851","title":{"rendered":"\u3059\u3050\u3067\u304d\u308b\uff01Vue\u3067\u4e38\u30d0\u30c4\u30b2\u30fc\u30e0\u3092\u3064\u304f\u3063\u3066\u307f\u3088\u3046"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u904e\u53bb\u306b<a href=\"https:\/\/blog.capilano-fw.com\/?p=2302\">\u53cd\u5c04\u795e\u7d4c\u30b2\u30fc\u30e0<\/a>\u3084<a href=\"https:\/\/blog.capilano-fw.com\/?p=2707\">\u30bf\u30a4\u30d4\u30f3\u30b0\u30b2\u30fc\u30e0<\/a>\u306a\u3069\u3001Vue\u3092\u4f7f\u3063\u305f\u3061\u3087\u3063\u3068\u3057\u305f\u30b2\u30fc\u30e0\u306e\u4f5c\u308a\u65b9\u3092\u516c\u958b\u3057\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u6700\u8fd1Google Analytics\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u3053\u308c\u3089\u30b2\u30fc\u30e0\u8a18\u4e8b\u306e\u6ede\u5728\u6642\u9593\u306f\u4ed6\u3068\u6bd4\u3079\u308b\u3068\u9577\u3081\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3088\u308a\u7686\u3055\u3093\u306b\u559c\u3093\u3067\u3044\u305f\u3060\u3051\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002^^<\/p>\n<p>\u305f\u3060\u3001\u305d\u3046\u306f\u3044\u3063\u3066\u3082\u30b2\u30fc\u30e0\u958b\u767a\u3068\u306a\u308b\u3068\u898b\u305f\u76ee\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3082\u30d7\u30ed\u30b0\u30e9\u30e0\u7684\u306b\u306f\u30b3\u30fc\u30c9\u304c\u8907\u96d1\u3060\u3063\u305f\u308a\u3059\u308b\u306e\u3067\u3001\u4e3b\u306bVue\u30d3\u30ae\u30ca\u30fc\u306e\u65b9\u3005\u3078\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u305f\u3044\u79c1\u304b\u3089\u3059\u308b\u3068\u3069\u306e\u3088\u3046\u306a\u8a18\u4e8b\u304c\u3044\u3044\u304b\u5c11\u3057\u60a9\u307e\u3057\u304b\u3063\u305f\u308a\u3082\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\uff01<\/p>\n<p>\u4eca\u56de\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u3060\u3051\u3069\u6bd4\u8f03\u7684\u7c21\u5358\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3064\u304f\u308c\u308b\u3067\u3042\u308d\u3046\u300c\u25cb\u00d7\u30b2\u30fc\u30e0\u300d\u3092Vue\u3067\u3064\u304f\u308b\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u5b66\u7fd2\u306b\u5f79\u7acb\u3066\u3066\u304f\u3060\u3055\u3044\u306d\u3002<br \/>\n\uff08\u6700\u5f8c\u306b\u6559\u6750\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2158 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png\" alt=\"\" width=\"170\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png 170w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29-159x300.png 159w\" sizes=\"auto, (max-width: 170px) 100vw, 170px\" \/><\/p>\n<p>\u203b \u958b\u767a\u74b0\u5883\uff1a Vue 2.5<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u5b50\u4f9b\u306e\u9803\u3088\u304f\u53cb\u9054\u3068\u904a\u3093\u3060\u6b21\u306e\u3088\u3046\u306a\u25cb\u00d7\u30b2\u30fc\u30e0\uff08\uff13\u76ee\u4e26\u3079\uff09\u3092Vue\u3067\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2852\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_1.png\" alt=\"\" width=\"265\" height=\"253\" \/><\/p>\n<p>\u30eb\u30fc\u30eb\uff1a \u30d7\u30ec\u30a4\u30e4\u30fc\u304c\u4ea4\u4e92\u306b\u25cb\u00d7\u3092\u30de\u30b9\u306b\u7f6e\u3044\u3066\u3044\u304d\u3001\u3069\u3061\u3089\u304b\u306e\u30de\u30fc\u30af\u304c\uff13\u3064\u4e26\u3079\u3070\u52dd\u3061\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u5b9f\u88c5\u5185\u5bb9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u25cb\u306f\u8d64\u6587\u5b57\u3001\u00d7\u306f\u9752\u6587\u5b57\u306b\u3059\u308b\u3002<\/li>\n<li>\u3069\u3061\u3089\u306e\u756a\u304b\u304c\u5206\u304b\u308b\u3088\u3046\u306b\u300c\u25cb\uff08\u00d7\uff09\u30d7\u30ec\u30a4\u30e4\u30fc\u3055\u3093\u3001\u30de\u30b9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u300d\u3068\u8868\u793a\u3059\u308b\uff08\u3064\u307e\u308a\uff12P\u30d7\u30ec\u30a4\uff09<\/li>\n<li>\u30b2\u30fc\u30e0\u304c\u7d42\u4e86\u3057\u305f\u3089\u300c\u25cb\uff08\u00d7\uff09\u3055\u3093\u306e\u52dd\u3061\u3067\u3059\u3002\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01\u300d\u3068\u8868\u793a\u3059\u308b<\/li>\n<li>\u5f15\u304d\u5206\u3051\u306e\u5834\u5408\u306f\u300c\u5f15\u304d\u5206\u3051\u3067\u3059\uff01\u300d\u3068\u8868\u793a\u3059\u308b<\/li>\n<\/ul>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h1>Vue\u306e\u57fa\u672c\u5f62\u3092\u3064\u304f\u308b<\/h1>\n<p>\u307e\u305a\u306fVue\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u57fa\u672c\u5f62\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;style&gt;&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div <strong>id=\"app\"<\/strong>&gt;\r\n\r\n        <strong>&lt;!-- \u3053\u3053\u304cVue\u30a8\u30ea\u30a2 --&gt;<\/strong>\r\n\r\n    &lt;\/div&gt;\r\n    <strong>&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.5.17\/dist\/vue.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n    <strong>&lt;script&gt;<\/strong>\r\n\r\n<strong>        new Vue({<\/strong>\r\n<strong>            el: '#app'<\/strong>\r\n<strong>        })<\/strong>\r\n\r\n<strong>    &lt;\/script&gt;<\/strong>\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001<code>cdn<\/code>\u304b\u3089Vue\u672c\u4f53\u3092\u8aad\u307f\u8fbc\u307f\u3001<code>app<\/code>\u3068\u3044\u3046<code>id<\/code>\u3092<code>Vue<\/code>\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<h1>\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066<code>\u25cb<\/code>\u3001<code>\u00d7<\/code>\u3092\u66f8\u3044\u3066\u3044\u304f\u30b2\u30fc\u30e0\u306e\u30de\u30b9\u76ee\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n\r\n    <strong>&lt;style&gt;<\/strong>\r\n\r\n<strong>        #table {<\/strong>\r\n\r\n<strong>            margin:0 auto;<\/strong>\r\n<strong>            border-collapse: collapse;<\/strong>\r\n<strong>            border: 3px solid #ccc;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        #table td {<\/strong>\r\n\r\n<strong>            border:1px solid #ccc;<\/strong>\r\n<strong>            height: 80px;<\/strong>\r\n<strong>            width: 80px;<\/strong>\r\n<strong>            text-align: center;<\/strong>\r\n<strong>            vertical-align: middle;<\/strong>\r\n<strong>            font-size: 75px;<\/strong>\r\n<strong>            cursor: pointer;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    &lt;\/style&gt;<\/strong>\r\n\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        <strong>&lt;table id=\"table\"&gt;<\/strong>\r\n<strong>            &lt;tr&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>            &lt;\/tr&gt;<\/strong>\r\n<strong>            &lt;tr&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>            &lt;\/tr&gt;<\/strong>\r\n<strong>            &lt;tr&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;td&gt;&lt;\/td&gt;<\/strong>\r\n<strong>            &lt;\/tr&gt;<\/strong>\r\n<strong>        &lt;\/table&gt;<\/strong>\r\n    &lt;\/div&gt;\r\n    &lt;!-- \u7701\u7565 --&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u4e2d\u8eab\u306f\uff13\u00d7\uff13\u306e\u30de\u30b9\u304c\u3042\u308b<code>&lt;table&gt;\u301c&lt;\/table&gt;<\/code>\u30bf\u30b0\u3092\u4f5c\u3063\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<br \/>\n\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2853\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_2.png\" alt=\"\" width=\"267\" height=\"259\" \/><\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u30de\u30b9\u76ee\u3092\u4f7f\u3063\u3066Vue\uff08JavaScript\uff09\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h1>JavaScript\u90e8\u5206\u3092\u3064\u304f\u308b<\/h1>\n<h2>Vue\u306b\u5909\u6570\u3092\u3064\u304f\u308b<\/h2>\n<p>\u307e\u305a\u3001\u25cb\u00d7\u30b2\u30fc\u30e0\u3067\u5fc5\u8981\u306a\u5909\u6570\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u5fc5\u8981\u306a\u3082\u306e\u306f\u6b21\u306e\uff12\u70b9\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u30de\u30b9\u76ee\u306e\u72b6\u614b\uff08\uff13\u00d7\uff13\u306e\u914d\u5217\uff09<\/li>\n<li>\u9078\u629e\u3067\u304d\u308b\u30d7\u30ec\u30a4\u30e4\u30fc\u306eID<\/li>\n<\/ul>\n<p>\uff13\u00d7\uff13\u306e\u914d\u5217\u306e\u4e2d\u8eab\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>-1\u3000\u30fb\u30fb\u30fb\u3000\u307e\u3060\u9078\u629e\u3055\u308c\u3066\u306a\u3044<\/li>\n<li>1\u3000\u30fb\u30fb\u30fb\u3000\u25cb\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b<\/li>\n<li>2\u3000\u30fb\u30fb\u30fb\u3000\u00d7\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001\u30d7\u30ec\u30a4\u30e4\u30fcID\u306f<\/p>\n<ul>\n<li>1\u3000\u30fb\u30fb\u30fb\u3000\u25cb\u306e\u30d7\u30ec\u30a4\u30e4\u30fc<\/li>\n<li>2\u3000\u30fb\u30fb\u30fb\u3000\u00d7\u306e\u30d7\u30ec\u30a4\u30e4\u30fc<\/li>\n<\/ul>\n<p>\u305d\u3057\u3066\u3001\u3053\u308c\u3089\u3092Vue\u306e\u5909\u6570\u306b\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>new Vue({\r\n    el: '#app',\r\n    <strong>data: {<\/strong>\r\n<strong>        states: [<\/strong>\r\n<strong>            [-1, -1, -1],<\/strong>\r\n<strong>            [-1, -1, -1],<\/strong>\r\n<strong>            [-1, -1, -1]<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        playerId: 1 \/\/ \u25cb\u306e\u30d7\u30ec\u30a4\u30e4\u30fc\u304b\u3089\u958b\u59cb<\/strong>\r\n<strong>    }<\/strong>\r\n})<\/pre>\n<h2>\u5909\u6570\u3092\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3059\u308b<\/h2>\n<p>\u3067\u306f\u3001\u8a2d\u5b9a\u3057\u305f\u5909\u6570\u3092HTML\u5185\u306b\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305a\u306f\u30de\u30b9\u76ee\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre>&lt;table id=\"table\"&gt;\r\n    &lt;tr <strong>v-for=\"row in states\"<\/strong>&gt;\r\n        &lt;td <strong>v-for=\"state in row\"<\/strong>&gt;\r\n            <strong>&lt;div style=\"color:#f00;\" v-if=\"state==1\"&gt;\u25cb&lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div style=\"color:#00f;\" v-if=\"state==2\"&gt;\u00d7&lt;\/div&gt;<\/strong>\r\n        &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n&lt;\/table&gt;<\/pre>\n<p>\u3053\u3053\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001\u5148\u307b\u3069\u3064\u304f\u3063\u305f<code>data<\/code>\u5909\u6570\u306e<code>states<\/code>\u3092<code>v-for<\/code>\u3092\u4f7f\u3063\u3066\u30eb\u30fc\u30d7\u3055\u305b\u3001\uff13\u00d7\uff13\u306e\u30de\u30b9\u3092\u4f5c\u308b\u3068\u540c\u6642\u306b\u3001\u30de\u30b9\u76ee\u306e\u72b6\u614b\u306b\u3088\u3063\u3066<code>\u25cb<\/code>\u3001<code>\u00d7<\/code>\u3001\u7a7a\u767d\u3092\u5207\u308a\u66ff\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u521d\u671f\u5024\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u5b9f\u969b\u306b\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>states: <strong>[<\/strong>\r\n<strong>    [2, 2, 2],<\/strong>\r\n<strong>    [-1, -1, -1],<\/strong>\r\n<strong>    [1, 1, 1]<\/strong>\r\n<strong>]<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2854\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_3.png\" alt=\"\" width=\"268\" height=\"258\" \/><\/p>\n<p>\u3046\u307e\u304f\u3044\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u7d9a\u3044\u3066<code>playerId<\/code>\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u73fe\u5728\u30de\u30b9\u3092\u9078\u3076\u3053\u3068\u304c\u3067\u304d\u308b\u30d7\u30ec\u30a4\u30e4\u30fc\u306eID\u306a\u306e\u3067\u3001\u3053\u306eID\u3092\u4f7f\u3063\u3066\u6b21\u306e\uff12\u3064\u306e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u25cb \u30d7\u30ec\u30a4\u30e4\u30fc\u3055\u3093\u3001\u30de\u30b9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044<\/li>\n<li>\u00d7 \u30d7\u30ec\u30a4\u30e4\u30fc\u3055\u3093\u3001\u30de\u30b9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044<\/li>\n<\/ul>\n<pre>&lt;table id=\"table\"&gt;\r\n    &lt;!-- \u7701\u7565 --&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;div style=\"text-align:center;\"&gt;\r\n    <strong>&lt;div style=\"color:#f00;\" v-if=\"playerId==1\"&gt;\u300c\u25cb \u30d7\u30ec\u30a4\u30e4\u30fc\u3055\u3093\u3001\u30de\u30b9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u300d&lt;\/div&gt;<\/strong>\r\n<strong>    &lt;div style=\"color:#00f;\" v-if=\"playerId==2\"&gt;\u300c\u00d7 \u30d7\u30ec\u30a4\u30e4\u30fc\u3055\u3093\u3001\u30de\u30b9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u300d&lt;\/div&gt;<\/strong>\r\n&lt;\/div&gt;<\/pre>\n<p>\u5b9f\u884c\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2855\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_4.png\" alt=\"\" width=\"301\" height=\"300\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_4.png 301w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_4-150x150.png 150w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_4-300x299.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_4-100x100.png 100w\" sizes=\"auto, (max-width: 301px) 100vw, 301px\" \/><\/p>\n<h2>\u30de\u30b9\u76ee\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306e\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h2>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30de\u30b9\u76ee\u304c\u9078\u629e\u3055\u308c\u305f\u3068\u304d\u306e\u30b3\u30fc\u30c9\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u30de\u30b9\u76ee\u306b\u306a\u308b<code>&lt;td&gt;<\/code>\u30bf\u30b0\u306b\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u3067<code>onSelect()<\/code>\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;table id=\"table\"&gt;\r\n    &lt;tr v-for=\"(row,<strong>rowsIndex<\/strong>) in states\"&gt;\r\n        &lt;td v-for=\"(state,<strong>colsIndex<\/strong>) in row\" <strong>@click=\"onSelect(rowsIndex, colsIndex)\"<\/strong>&gt;\r\n            &lt;!-- \u7701\u7565 --&gt;\r\n        &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n&lt;\/table&gt;<\/pre>\n<p>\u306a\u304a\u3001\u9078\u629e\u3055\u308c\u305f\u30de\u30b9\u304c\u3069\u3053\u306a\u306e\u304b\u304c\u5206\u304b\u308b\u3088\u3046\u306b\u3001<code>v-for<\/code>\u306b\u306f\u305d\u308c\u305e\u308c<code>rowsIndex<\/code>\u3068<code>colsIndex<\/code>\u3092\u8ffd\u52a0\u3057\u3066<code>onSelect()<\/code>\u3078\u9001\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u30e1\u30bd\u30c3\u30c9\u672c\u4f53\u3067\u3059\u3002<\/p>\n<pre>new Vue({\r\n    \/\/ \u7701\u7565\r\n    <strong>methods: {<\/strong>\r\n<strong>        onSelect: function(rowsIndex, colsIndex) {<\/strong>\r\n\r\n<strong>            if(this.states[rowsIndex][colsIndex] != -1) {<\/strong>\r\n\r\n<strong>                alert('\u305d\u306e\u30de\u30b9\u306f\u3001\u3059\u3067\u306b\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u3059\uff01');<\/strong>\r\n\r\n<strong>            } else {<\/strong>\r\n\r\n<strong>                var states = JSON.parse(JSON.stringify(this.states))<\/strong>\r\n<strong>                states[rowsIndex][colsIndex] = this.playerId;<\/strong>\r\n<strong>                this.states = states;<\/strong>\r\n<strong>                this.playerId = (this.playerId == 1) ? 2 : 1;<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    }<\/strong>\r\n})<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3001\u307e\u305a\u9078\u629e\u3055\u308c\u305f\u30de\u30b9\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u3001\u3082\u3057<code>-1<\/code>\u3067\u306a\u3051\u308c\u3070\uff08\u3064\u307e\u308a\u3001\u3059\u3067\u306b\u9078\u629e\u6e08\u307f\u306a\u3089\uff09\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u3053\u304c\u91cd\u8981\u306a\u306e\u3067\u3059\u304c\u3001Vue\u306e\u914d\u5217\u3092\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u306f<strong>\u5909\u6570\u81ea\u4f53\u3092\u66f8\u304d\u63db\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/strong>\u3064\u307e\u308a\u3001\u3053\u306e\u5834\u5408\u3060\u3068<\/p>\n<pre>this.states[rowsIndex][colsIndex] = this.playerId;<\/pre>\n<p>\u3068\u3057\u3066\u3082\u3001\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3055\u308c\u305f\u90e8\u5206\u306f\u65b0\u3057\u304f\u66f8\u304d\u63db\u3048\u3089\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u5c11\u3057\u307e\u308f\u308a\u304f\u3069\u3044\u3067\u3059\u304c\u3001\u307e\u305a\u5143\u3005\u306e\u30c7\u30fc\u30bf\u3092\u4e00\u65e6JSON\u306b\u3057\u3066\u518d\u5ea6\u5143\u306b\u623b\u3059\u3053\u3068\u3067\u914d\u5217\u3092\u30b3\u30d4\u30fc\u3002\u305d\u3057\u3066\u3001\u9078\u629e\u3055\u308c\u305f\u30de\u30b9\u76ee\u306e\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3057\u3001\u6700\u5f8c\u306b<code>this.states<\/code>\u5168\u4f53\u3092\u66f8\u304d\u63db\u3048\u308b\u3068\u3044\u3046\u65b9\u6cd5\u3092\u3068\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u304a\u597d\u307f\u3067<code>Vue.set()<\/code>\u3092\u4f7f\u3063\u3066\u3082\u3044\u3044\u3067\u3057\u3087\u3046\uff09<\/p>\n<p>\u307e\u305f\u3001\u9078\u629e\u304c\u6e08\u3093\u3060\u3042\u3068\u306f\u3001\u30d7\u30ec\u30a4\u30e4\u30fc\u3092\u4ea4\u4ee3\u3055\u305b\u308b\u305f\u3081\u306b<code>playerId<\/code>\u3092\u5909\u66f4\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30b2\u30fc\u30e0\u304c\u5b8c\u4e86\u3057\u305f\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/h2>\n<p>\u3053\u308c\u3067\u30de\u30b9\u76ee\u306e\u9078\u629e\u90e8\u5206\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u304c\u3001\u809d\u5fc3\u306e\u30b2\u30fc\u30e0\u306b\u52dd\u3063\u305f\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u6a5f\u80fd\u304c\u3064\u3044\u3066\u3044\u307e\u305b\u3093\u306e\u3067\u3001\u3053\u306e\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre>onSelect: function(rowsIndex, colsIndex) {\r\n\r\n    if(this.states[rowsIndex][colsIndex] != -1) {\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n    } else {\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n        <strong>var winnerId = this.getWinnerId();<\/strong>\r\n\r\n<strong>        if(winnerId != -1) {<\/strong>\r\n\r\n<strong>            this.states = [<\/strong>\r\n<strong>                [-1, -1, -1],<\/strong>\r\n<strong>                [-1, -1, -1],<\/strong>\r\n<strong>                [-1, -1, -1]<\/strong>\r\n<strong>            ];\r\n            playerIds = {\r\n                1: '\u25cb',\r\n                2: '\u00d7'\r\n            };<\/strong>\r\n<strong>            alert(playerIds[winnerId] +' \u3055\u3093\u306e\u52dd\u3061\u3067\u3059\u3002\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01');<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n    }\r\n\r\n},\r\n<strong>getWinnerId: function() {<\/strong>\r\n\r\n<strong>    for(var i = 0; i &lt; 3 ; i++){<\/strong>\r\n\r\n<strong>        \/\/ \u6a2a\u306e\u5217<\/strong>\r\n<strong>        var row = this.states[i];<\/strong>\r\n<strong>        if(this.isStatesFilled(row)) { return row[0];}<\/strong>\r\n\r\n<strong>        \/\/ \u7e26\u306e\u5217<\/strong>\r\n<strong>        var col = [<\/strong>\r\n<strong>            this.states[0][i],<\/strong>\r\n<strong>            this.states[1][i],<\/strong>\r\n<strong>            this.states[2][i]<\/strong>\r\n<strong>        ];<\/strong>\r\n<strong>        if(this.isStatesFilled(col)) { return this.states[0][i]; }<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    \/\/ \u306a\u306a\u3081<\/strong>\r\n<strong>    var skew1 = [<\/strong>\r\n<strong>        this.states[0][0],<\/strong>\r\n<strong>        this.states[1][1],<\/strong>\r\n<strong>        this.states[2][2]<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    if(this.isStatesFilled(skew1)) { return this.states[0][0]; }<\/strong>\r\n\r\n<strong>    var skew2 = [<\/strong>\r\n<strong>        this.states[0][2],<\/strong>\r\n<strong>        this.states[1][1],<\/strong>\r\n<strong>        this.states[2][0]<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    if(this.isStatesFilled(skew2)) { return this.states[0][2]; }<\/strong>\r\n\r\n<strong>    return -1;<\/strong>\r\n\r\n<strong>},<\/strong>\r\n<strong>isStatesFilled: function(states) {<\/strong>\r\n\r\n<strong>    return(<\/strong>\r\n<strong>        states[0] != -1 &amp;&amp;<\/strong>\r\n<strong>        states[0] == states[1] &amp;&amp;<\/strong>\r\n<strong>        states[1] == states[2]<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u5c11\u3057\u30b3\u30fc\u30c9\u304c\u9577\u3044\u306e\u3067\u3072\u3068\u3064\u305a\u3064\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a<code>getWinnerId()<\/code>\u306e\u4e2d\u3067\u306f\u3001<code>states<\/code>\u306e\u4e2d\u8eab\u3092<code>isStatesFilled()<\/code>\u3092\u4f7f\u3063\u3066\u6b21\u306e\u52dd\u5229\u6761\u4ef6\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u3055\u3089\u306b\u52dd\u3063\u305f\u30d7\u30ec\u30a4\u30e4\u30fc\u306eID\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>-1\u3092\u542b\u307e\u305a\uff08\u307e\u3060\u9078\u629e\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\uff09<\/li>\n<li>\u5168\u3066\u306e\u6570\u5b57\u304c\u540c\u3058\u5024\u3067\u3042\u308b<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2856\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/12\/vue_marubatsu_5.png\" alt=\"\" width=\"277\" height=\"265\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057\u3053\u306e\u52dd\u5229\u6761\u4ef6\u3092\u6e80\u305f\u3059\u5834\u5408\u306f<code>1<\/code>\u3082\u3057\u304f\u306f<code>2<\/code>\u306e\u52dd\u3063\u305f\u30d7\u30ec\u30a4\u30e4\u30fcID\u3092\u8fd4\u3057\u3001\u30a2\u30e9\u30fc\u30c8\u3092\u8868\u793a\u3002\u3055\u3089\u306b<code>states<\/code>\u3092\u521d\u671f\u5024\u3078\u623b\u3057\u307e\u3059\u3002<\/p>\n<h2>\u5f15\u304d\u5206\u3051\u306e\u5834\u5408\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/h2>\n<p>\u25cb\u00d7\u30b2\u30fc\u30e0\u306f\u3001\u5f15\u304d\u5206\u3051\u306e\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u52dd\u5229\u6761\u4ef6\u3092\u6e80\u305f\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f<code>isDraw()<\/code>\u3067\u5f15\u304d\u5206\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>onSelect: function(rowsIndex, colsIndex) {\r\n\r\n    if(this.states[rowsIndex][colsIndex] != -1) {\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n    } else {\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n        if(winnerId != -1) {\r\n\r\n            \/\/ \u7701\u7565\r\n\r\n        } <strong>else if(this.isDraw()) {<\/strong>\r\n\r\n<strong>            this.states = [<\/strong>\r\n<strong>                [-1, -1, -1],<\/strong>\r\n<strong>                [-1, -1, -1],<\/strong>\r\n<strong>                [-1, -1, -1]<\/strong>\r\n<strong>            ];<\/strong>\r\n<strong>            alert('\u5f15\u304d\u5206\u3051\u3067\u3059\uff01');<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n    }\r\n\r\n},\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>isDraw: function() {<\/strong>\r\n\r\n<strong>    for(var i in this.states) {<\/strong>\r\n\r\n<strong>        var row = this.states[i];<\/strong>\r\n\r\n<strong>        for(var j in row) {<\/strong>\r\n\r\n<strong>            var state = row[j];<\/strong>\r\n\r\n<strong>            if(state == -1) {<\/strong>\r\n\r\n<strong>                return false;<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    return true;<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p><code>isDraw()<\/code>\u306e\u4e2d\u3067\u306f<code>states<\/code>\u306e\u4e2d\u8eab\u3092\u3059\u3079\u3066\u30c1\u30a7\u30c3\u30af\u3057\u3066<code>-1<\/code>\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u3089\uff08\u3064\u307e\u308a\u307e\u3060\u30b2\u30fc\u30e0\u306f\u7d42\u308f\u3063\u3066\u3044\u306a\u3044\uff09<code>false<\/code>\u3092\u8fd4\u3057\u3001\u305d\u3046\u3067\u306a\u3051\u308c\u3070\u30b2\u30fc\u30e0\u306f\u7d42\u4e86\u3057\u3066\u3044\u308b\u306e\u306b\u52dd\u6557\u304c\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\uff08\uff1d\u5f15\u304d\u5206\u3051\uff09\u3068\u3044\u3046\u3053\u3068\u3067<code>true<\/code>\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3082\u3057\u5f15\u304d\u5206\u3051\u306e\u5834\u5408\u306f\u30a2\u30e9\u30fc\u30c8\u3092\u8d77\u52d5\u3057\u3066\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\uff01<\/p>\n<h1>\u304a\u307e\u3051 &#8211; 1\uff08\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\uff09<\/h1>\n<p>\u4eca\u56de\u7d39\u4ecb\u3057\u305f\u30b3\u30fc\u30c9\u306e\u4e2d\u306b\u306f\u8907\u6570\u56de\u540c\u3058\u30b3\u30fc\u30c9\u304c\u51fa\u3066\u304f\u308b\u5834\u9762\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3067\u3059\u3002<code>states<\/code>\u3092\u521d\u671f\u5316\u3059\u308b\u90e8\u5206\u3067\u3059\u306d\u3002<\/p>\n<pre>this.states = [\r\n    [-1, -1, -1],\r\n    [-1, -1, -1],\r\n    [-1, -1, -1]\r\n];<\/pre>\n<p>\u540c\u3058\u30b3\u30fc\u30c9\u306f\u3067\u304d\u308b\u3060\u3051\u4e00\u56de\u66f8\u304f\u3060\u3051\u306b\u3057\u3066\u304a\u304f\u307b\u3046\u304c\u3044\u3044\u306e\u3067<code>init()<\/code>\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u3063\u3066\u3053\u306e\u4e2d\u3067<code>states<\/code>\u3092\u521d\u671f\u5316\u3059\u308b\u3088\u3046\u306b\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>methods: {\r\n    <strong>init: function() {<\/strong>\r\n\r\n<strong>        this.states = [<\/strong>\r\n<strong>            [-1, -1, -1],<\/strong>\r\n<strong>            [-1, -1, -1],<\/strong>\r\n<strong>            [-1, -1, -1]<\/strong>\r\n<strong>        ];<\/strong>\r\n\r\n<strong>    },<\/strong>\r\n\r\n    \/\/ \u7701\u7565<\/pre>\n<p>\u305d\u3057\u3066\u3001<code>init()<\/code>\u3092\u547c\u3073\u51fa\u3059\u5834\u6240\u306f\u5148\u307b\u3069\u306e<code>onSelect()<\/code>\u306e\u4e2d\u3067\u3059\u306d\u3002<\/p>\n<pre>onSelect: function(rowsIndex, colsIndex) {\r\n\r\n    if(this.states[rowsIndex][colsIndex] != -1) {\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n    } else {\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n        if(winnerId != -1) {\r\n\r\n            <strong>this.init();<\/strong>\r\n            playerIds = {\r\n                1: '\u25cb',\r\n                2: '\u00d7'\r\n            };\r\n            alert(playerIds[winnerId] +' \u3055\u3093\u306e\u52dd\u3061\u3067\u3059\u3002\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01');\r\n\r\n        } else if(this.isDraw()) {\r\n\r\n            <strong>this.init();<\/strong>\r\n            alert('\u5f15\u304d\u5206\u3051\u3067\u3059\uff01');\r\n\r\n        }\r\n\r\n    }\r\n\r\n},<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3082\u3046\u4e00\u3064\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30c7\u30fc\u30bf\u306e\u521d\u671f\u5024\u3067\u3059\u3002<\/p>\n<p>\u4eca\u307e\u3067\u76f4\u63a5\u5024\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u7a7a\u767d\u306e\u914d\u5217\u3078\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>data: {\r\n    <strong>states: []<\/strong>, \/\/ \u521d\u671f\u5024\u306fmounted\u306e\u4e2d\u3067\u8a2d\u5b9a\r\n    \/\/ \u7701\u7565\r\n},<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u305f\u3089\u3059\u3050\u306b\u5b9f\u884c\u3055\u308c\u308b<code>mounted<\/code>\u306e\u4e2d\u3067<code>init()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3068\u53ef\u8aad\u6027\u3082\u3042\u304c\u308a\u307e\u3059\u3057\u3001\u30b3\u30fc\u30c9\u306e\u5171\u901a\u5316\u304c\u3067\u304d\u3066\u4fdd\u5b88\u3082\u3057\u3084\u3059\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre>mounted: function() {\r\n\r\n    <strong>this.init();<\/strong>\r\n\r\n}<\/pre>\n<h1>\u304a\u307e\u3051 &#8211; 2\uff08\u52dd\u3063\u305f\u6642\u306b\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\uff09<\/h1>\n<p>\u5148\u307b\u3069\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u25cb\u00d7\u3069\u3061\u3089\u304b\u306e\u30d7\u30ec\u30a4\u30e4\u30fc\u304c\u52dd\u3063\u305f\u3068\u304d\u306b\u30a2\u30e9\u30fc\u30c8\u3092\u8868\u793a\u3059\u308b\u3060\u3051\u3067\u3057\u305f\u304c\u3001\u3061\u3087\u3063\u3068\u3053\u308c\u3060\u3051\u3067\u306f\u5473\u6c17\u306a\u3044\u306e\u3067\u52dd\u3063\u305f\u3089\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002\uff08\u305f\u3060\u3057\u3001\u5bfe\u6226\u4e2d\u306f\u8868\u793a\u3057\u307e\u305b\u3093\uff09<\/p>\n<p>\u307e\u305a\u306f\u5909\u6570\u90e8\u5206\u3067\u3059\u3002<br \/>\n<code>winnerText<\/code>\u3068\u3044\u3046\u5909\u6570\u3092\u8ffd\u52a0\u3057\u3001\u3069\u3061\u3089\u304b\u304c\u52dd\u3063\u305f\u3068\u304d\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u3053\u3053\u3078\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n<pre>data: {\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>winnerText: ''<\/strong>\r\n},<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre>&lt;div <strong>v-if=\"winnerText\"<\/strong> style=\"text-align:center;\"&gt;\r\n    <strong>&lt;h2 v-text=\"winnerText\"&gt;&lt;\/h2&gt;<\/strong>\r\n<strong>    &lt;img src=\"\/images\/congrats.png\"&gt;<\/strong>\r\n&lt;\/div&gt;<\/pre>\n<p>\u3082\u3057<code>winnerText<\/code>\u306e\u4e2d\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u5165\u3063\u3066\u3044\u308c\u3070\u3001\u305d\u306e\u30c6\u30ad\u30b9\u30c8\u3068\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>winnerText<\/code>\u306f\u30de\u30b9\u304c\u9078\u629e\u3055\u308c\u308b\u5ea6\u306b\u521d\u671f\u5316\u3057\u307e\u3059\u304c\u3001\u3082\u3057\u3069\u3061\u3089\u304b\u304c\u52dd\u3063\u305f\u5834\u5408\u3060\u3051\u30c6\u30ad\u30b9\u30c8\u3092\u683c\u7d0d\u3057\u307e\u3059\u3002\uff08\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u5bfe\u6226\u4e2d\u306b\u30c6\u30ad\u30b9\u30c8\u3068\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u304f\u306a\u308a\u307e\u3059\uff09<\/p>\n<pre>onSelect: function(rowsIndex, colsIndex) {\r\n\r\n    this.winnerText = '';\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n        if(winnerId != -1) {\r\n\r\n            \/\/ \u7701\u7565\r\n\r\n            <strong>this.winnerText = playerIds[winnerId] +' \u3055\u3093\u306e\u52dd\u3061\u3067\u3059\u3002\u304a\u3081\u3067\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01';<\/strong>\r\n\r\n        }\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n}<\/pre>\n<h1>\u30c7\u30e2\u3092\u7528\u610f\u3057\u307e\u3057\u305f<\/h1>\n<p>\u4eca\u56de\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u969b\u306b\u4f53\u9a13\u3057\u3066\u3044\u305f\u3060\u304f\u305f\u3081\u306b<a href=\"https:\/\/demo-laravel52.capilano-fw.com\/vue_marubatsu\" target=\"_blank\" rel=\"noopener noreferrer\">\u30c7\u30e2\u30da\u30fc\u30b8<\/a>\u3092\u7528\u610f\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305c\u3072\u697d\u3057\u3093\u3067\u4f53\u9a13\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<h1>\u6559\u6750\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<code>cdn<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u5c55\u958b\u3057\u3066\u3059\u3050\u4f53\u9a13\u3067\u304d\u307e\u3059\u3088\uff01<\/p>\n<p>\u203b \u305f\u3060\u3057\u753b\u50cf\u3092\u3054\u81ea\u8eab\u3067\u7528\u610f\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=2857&amp;tmstv=1777665842\" rel=\"nofollow\" id=\"download-link-2857\" data-redirect=\"false\" >\n\tVue\u3067\u4e38\u30d0\u30c4\u30b2\u30fc\u30e0\u3092\u3064\u304f\u308b<\/a>\n\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3001Vue\u3092\u4f7f\u3063\u3066\u5b50\u4f9b\u306e\u9803\u3088\u304f\u3084\u3063\u305f\u30b2\u30fc\u30e0\u300c\u25cb\u00d7\u30b2\u30fc\u30e0\u300d\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u304d\u308b\u3060\u3051\u5206\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u3053\u3068\u3092\u5fc3\u304c\u3051\u3066\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u3084\u306f\u308a\u5192\u982d\u3067\u3082\u3044\u3063\u305f\u3068\u304a\u308a\u3001\u30b2\u30fc\u30e0\u306e\u30b3\u30fc\u30c9\u306f\u8272\u3005\u3068\u6570\u5b66\u7684\u306a\u767a\u60f3\u3082\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u306e\u3067\u898b\u305f\u76ee\u3088\u308a\u306f\u5c11\u3057\u8907\u96d1\u306a\u30b3\u30fc\u30c9\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305f\u3060\u3001\u4ee5\u524d\u30a2\u30d7\u30ea\u3067\u500b\u4eba\u7684\u306b\u30b2\u30fc\u30e0\u3092\u4f5c\u3063\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3084\u3063\u3071\u308a\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u306e\u306f\u697d\u3057\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3046\u3044\u3046\u610f\u5473\u3067\u306f\u3001\u5b50\u4f9b\u306e\u9803\u30c6\u30ec\u30d3\u30b2\u30fc\u30e0\u3092\u5922\u4e2d\u306b\u306a\u3063\u3066\u3084\u3063\u305f\u7d4c\u9a13\u3082\u751f\u304d\u3066\u304d\u3066\u3044\u308b\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff08\u30fb\u30fb\u30fb\u3068\u4fe1\u3058\u305f\u3044\u3067\u3059 ^^;\uff09<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/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","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u904e\u53bb\u306b\u53cd\u5c04\u795e\u7d4c\u30b2\u30fc\u30e0\u3084\u30bf\u30a4\u30d4\u30f3\u30b0\u30b2\u30fc\u30e0\u306a\u3069\u3001Vue\u3092\u4f7f\u3063\u305f\u3061\u3087\u3063\u3068\u3057\u305f\u30b2\u30fc\u30e0\u306e\u4f5c\u308a\u65b9\u3092\u516c\u958b\u3057\u3066\u304d\u307e\u3057\u305f\u3002 \u305d\u3057\u3066\u3001\u6700\u8fd1Google An &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2851\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3059\u3050\u3067\u304d\u308b\uff01Vue\u3067\u4e38\u30d0\u30c4\u30b2\u30fc\u30e0\u3092\u3064\u304f\u3063\u3066\u307f\u3088\u3046&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2862,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[112],"class_list":["post-2851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vue-js","tag-112"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2851","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=2851"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2851\/revisions"}],"predecessor-version":[{"id":6776,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2851\/revisions\/6776"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2862"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}