{"id":10784,"date":"2022-07-18T07:00:48","date_gmt":"2022-07-17T22:00:48","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=10784"},"modified":"2022-07-14T05:25:04","modified_gmt":"2022-07-13T20:25:04","slug":"vue-3-%e3%81%a7%e3%81%82%e3%81%ae%e3%80%8c%e8%90%bd%e3%81%a1%e3%82%82%e3%81%ae%e3%83%91%e3%82%ba%e3%83%ab%e3%82%b2%e3%83%bc%e3%83%a0%e3%80%8d%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=10784","title":{"rendered":"Vue 3 \u3067\u3042\u306e\u300c\u843d\u3061\u3082\u306e\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\u300d\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u7686\u3055\u3093\u3082\u5b63\u7bc0\u304c\u5909\u308f\u308b\u3068\u5370\u8c61\u6df1\u3044\u3053\u3068\u3092\u601d\u3044\u51fa\u3059\u3053\u3068\u3082\u3042\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002\u3061\u306a\u307f\u306b\u79c1\u306e\u5834\u5408\u3001\u6691\u3044\u590f\u306f\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u300c\u590f\u4f11\u307f\u306e\u5bbf\u984c\u3067\u3084\u3063\u305f\u81ea\u7531\u7814\u7a76\u304c\u697d\u3057\u304b\u3063\u305f\u300d<\/strong><\/p>\n<p>\u3053\u3068\u3092\u3088\u304f\u601d\u3044\u51fa\u3057\u307e\u3059\u3002\uff08\u4ed6\u306f\u5168\u304f\u3067\u3059\u3051\u3069\u306d\ud83d\ude2b\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306a\u3053\u3068\u3092\u8003\u3048\u3066\u3044\u308b\u3068\u300c<strong>\u52dd\u624b\u306b\u81ea\u7531\u7814\u7a76\u3057\u3088\u3063\u304b\u306a<\/strong>\u300d\u3068\u3044\u3046\u6c17\u5206\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u3068\u8003\u3048\u3066\u307f\u305f\u3068\u3053\u308d\u300c<strong>\u3069\u3046\u305b\u306a\u3089\u5c0f\u5b66\u751f\u306e\u81ea\u5206\u306b\u898b\u305b\u305f\u3089\u9a5a\u304f\u3060\u308d\u3046\u306a<\/strong>\u300d\u3068\u3044\u3046\u3082\u306e\u3092\u3064\u304f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30ba\u30d0\u30ea\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u300c\u30c6\u25cf\u30ea\u30b9\uff08\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\uff09\u300d<\/strong><\/p>\n<p>\u3067\u3059\u3002\uff08\u306a\u305c\u4f0f\u305b\u5b57\u306a\u306e\u304b\u306f\u3001\u5f8c\u307b\u3069\u8aac\u660e\u3057\u307e\u3059\uff09<\/p>\n<p>\u305d\u3046\u3067\u3059\u3002<br \/>\n\u5c0f\u5b66\u751f\u306e\u9803\u306f\u81ea\u5206\u3067\u30b2\u30fc\u30e0\u306a\u3093\u3066\u3064\u304f\u308c\u308b\u3068\u306f\u601d\u3063\u3066\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u3082\u3057\u30bf\u30a4\u30e0\u30de\u30b7\u30fc\u30f3\u304c\u3042\u3063\u305f\u3089\u300c\u3059\u3052\u3048\uff01\u300d\u3068\u8a00\u3063\u3066\u304f\u308c\u308b\u3068\u601d\u3063\u305f\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f<code>Vue 3<\/code>\u3092\u4f7f\u3063\u3066\u3053\u306e\u300c<strong>\u6709\u540d\u843d\u3061\u3082\u306e\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0<\/strong>\u300d\u3092\u3064\u304f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/>\u300c\u30db\u30ef\u30a4\u30c8\u30cb\u30f3\u30b0\u6b6f\u78e8\u304d\u7c89\u3001<br \/>\n\u5f90\u3005\u306b\u52b9\u679c\u3042\u308a\u2757\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Vue 3<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p><a href=\"https:\/\/hotnews8.net\/society\/tetris-copyright\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8<\/a> \u306b\u3088\u308b\u3068\u3001\u300c\u30c6\u25cf\u30ea\u30b9\u300d\u3068\u3044\u3046\u540d\u524d\u3084\u3001\u5185\u5bb9\u3092\u5168\u304f\u540c\u3058\u306b\u3059\u308b\u306e\u306f\u6a29\u5229\u95a2\u4fc2\u4e0a\u554f\u984c\u304c\u3042\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u30de\u30b9\u76ee\u3084\u30d6\u30ed\u30c3\u30af\u306e\u7a2e\u985e\u3001\u307e\u305f\u30d6\u30ed\u30c3\u30af\u3092\u69cb\u6210\u3059\u308b\u6570\u306a\u3069\u5168\u3066\u672c\u5bb6\u3068\u306f\u9055\u3063\u305f\u3082\u306e\u306b\u3057\u3001\u3055\u3089\u306b\u30d6\u30ed\u30c3\u30af\u81ea\u4f53\u3082\u4ee5\u4e0b\u306e\u79c1\u306e\u9854\u5199\u771f\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10785\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/07\/profile_face.png\" alt=\"\" width=\"100\" height=\"100\" \/>\uff08\u82e5\u304b\u308a\u3057\u2026\ud83d\ude02\uff09<\/p>\n<p>\u307e\u305f\u3001\u30c7\u30e2\u30da\u30fc\u30b8\u3082\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u52d5\u4f5c\u78ba\u8a8d\u304c\u4e3b\u76ee\u7684\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u6b63\u76f4\u306a\u3068\u3053\u308d\u4eca\u56de\u306e\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\u306f\u300c<strong>\u914d\u5217\u3092\u7528\u610f\u3057\u3066\u4e2d\u8eab\u3092\u5909\u66f4\u3059\u308b\u3060\u3051\u3067\u3057\u3087\u301c<\/strong>\u300d\u3068\u8efd\u304f\u8003\u3048\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3093\u306a\u306b\u7518\u304f\u306a\u304f\u3001\u3068\u3066\u3082\u8907\u96d1\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\uff08\u7279\u306b\u56de\u8ee2\u90e8\u5206\u304c\u96e3\u3057\u304b\u3063\u305f\u3067\u3059\u2026\ud83d\ude2b \u3082\u3057\u30d0\u30b0\u304c\u3042\u3063\u3066\u3082\u3001\u3082\u3046\u89e6\u308a\u305f\u304f\u306a\u3044\ud83d\ude02\uff09<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u521d\u5b66\u8005\u5411\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u3057\u3066\u306f\u9069\u3057\u3066\u3044\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u3053\u3093\u306a\u6559\u6750\u304c\u59cb\u3081\u306b\u51fa\u3066\u304d\u305f\u3089\u3001\u5acc\u306b\u306a\u3063\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3084\u3081\u3066\u305f\u304b\u3082\u3067\u3059\u2026\uff09<\/p>\n<p>\u3064\u307e\u308a\u3001\u5192\u982d\u3067\u3082\u66f8\u3044\u305f\u3068\u304a\u308a\u4eca\u56de\u306f\u79c1\u306e\u300c<strong>\u590f\u4f11\u307f\u306e\u5de5\u4f5c\uff08\u81ea\u5df1\u6e80\u8db3\uff09<\/strong>\u300d\u767a\u8868\u3050\u3089\u3044\u3067\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u306d\uff08\u300c\u3088\u304f\u3067\u304d\u307e\u3057\u305f\u300d\u3068\u8a00\u3063\u3066\u304f\u3060\u3055\u3044\uff01\uff09<\/p>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u307f\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<h1>\u30c7\u30e2\u30da\u30fc\u30b8\u306f\u3053\u3061\u3089<\/h1>\n<p>\u30b3\u30fc\u30c9\u3092\u898b\u308b\u524d\u306b\u30c7\u30e2\u30da\u30fc\u30b8\u3092\u4f53\u9a13\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\ud83d\udcdd <a href=\"https:\/\/demo-laravel9x.capilano-fw.com\/block_game\" target=\"_blank\" rel=\"noopener\">\u30c7\u30e2\u30da\u30fc\u30b8\uff08\u65e5\u672c\u8a9e\u7248\uff09<\/a> \uff0f <a href=\"https:\/\/demo-laravel9x.capilano-fw.com\/block_game_en\" target=\"_blank\" rel=\"noopener\">\uff08\u82f1\u8a9e\u7248\uff09<\/a><\/p>\n<h1>Vue \u3067\u843d\u3061\u3082\u306e\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30e1\u30a4\u30f3\u306e\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>block_game.html<\/strong><\/p>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;<\/strong>\r\n<strong>    &lt;link href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.1\/dist\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;<\/strong>\r\n<strong>    &lt;style&gt;<\/strong>\r\n\r\n<strong>        body {<\/strong>\r\n\r\n<strong>            background-image: linear-gradient(180deg, #aff, #ddd);<\/strong>\r\n<strong>            border: 8px solid #7cc;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        #block-game-table {<\/strong>\r\n\r\n<strong>            margin: 40px auto;<\/strong>\r\n<strong>            border-collapse: collapse;<\/strong>\r\n<strong>            background-color: #f9f9f9;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        #block-game-table td {<\/strong>\r\n\r\n<strong>            border: 1px solid #ccc;<\/strong>\r\n<strong>            width: 30px;<\/strong>\r\n<strong>            height: 30px;<\/strong>\r\n<strong>            text-align: center;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        #block-game-table td img {<\/strong>\r\n\r\n<strong>            height: 26px;<\/strong>\r\n<strong>            border-radius: 15px;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        .disable-dbl-tap-zoom {<\/strong>\r\n\r\n<strong>            touch-action: manipulation;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    &lt;\/style&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>&lt;div id=\"app\" class=\"pt-4\"&gt;<\/strong>\r\n<strong>    &lt;div class=\"h3 text-center\" style=\"text-shadow: 2px 2px #eee;\"&gt;&amp;#x1F3AE; Vue 3 \u3067\u300c\u3042\u306e\u300d\u843d\u3061\u3082\u306e\u30b2\u30fc\u30e0\u3092\u3064\u304f\u308b&lt;\/div&gt;<\/strong>\r\n<strong>    &lt;table id=\"block-game-table\" class=\"shadow\"&gt;<\/strong>\r\n<strong>        &lt;tbody&gt;<\/strong>\r\n<strong>        &lt;tr v-for=\"rowBlocks in allBlocks\"&gt;<\/strong>\r\n<strong>            &lt;td v-for=\"block in rowBlocks\" :style=\"getBlockStyles(block)\"&gt;<\/strong>\r\n<strong>                &lt;img src=\"\/images\/profile_face.png\" v-if=\"! isEmpty(block)\"&gt;<\/strong>\r\n<strong>            &lt;\/td&gt;<\/strong>\r\n<strong>        &lt;\/tr&gt;<\/strong>\r\n<strong>        &lt;\/tbody&gt;<\/strong>\r\n<strong>    &lt;\/table&gt;<\/strong>\r\n<strong>    &lt;div class=\"text-center\"&gt;<\/strong>\r\n<strong>        &lt;button class=\"btn btn-primary btn-lg me-3 disable-dbl-tap-zoom\" @click=\"moveBlock('left')\"&gt;\u2190&lt;\/button&gt;<\/strong>\r\n<strong>        &lt;button class=\"btn btn-primary btn-lg me-3 disable-dbl-tap-zoom\" @click=\"moveBlock('right')\"&gt;\u2192&lt;\/button&gt;<\/strong>\r\n<strong>        &lt;button class=\"btn btn-primary btn-lg me-3 disable-dbl-tap-zoom\" @click=\"rotateBlock\"&gt;\u56de\u8ee2&lt;\/button&gt;<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;div class=\"text-center pt-4\"&gt;<\/strong>\r\n<strong>        \u6d88\u3057\u305f\u30d6\u30ed\u30c3\u30af\uff1a &lt;span v-text=\"removedLines\"&gt;&lt;\/span&gt; \u884c<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;p class=\"p-3 bg-info rounded m-4 border\" style=\"font-size:0.7rem;\"&gt;<\/strong>\r\n<strong>        \u3053\u306e\u30da\u30fc\u30b8\u306f Vue 3 \u306e\u5b66\u7fd2\u76ee\u7684\u306e\u30c7\u30e2\u3067\u3059\u3002\u5143\u8a18\u4e8b\u306f &lt;a href=\"https:\/\/blog.capilano-fw.com\/?p=10784\"&gt;\u3053\u3061\u3089&lt;\/a&gt;\u3002&lt;br&gt;<\/strong>\r\n<strong>        \u306a\u304a\u3001&lt;a href=\"https:\/\/hotnews8.net\/society\/tetris-copyright\"&gt;\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8&lt;\/a&gt; \u3092\u53c2\u8003\u306b\u3057\u985e\u4f3c\u6027\u3092\u4f4e\u304f\u3057\u305f\u3082\u306e\u3092\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3082\u3057\u6a29\u5229\u95a2\u4fc2\u306b\u554f\u984c\u304c\u3042\u308b\u3088\u3046\u3067\u3057\u305f\u3089\u3001&lt;a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSdqMmc1sGcm4BaHTInlMTn-8tFf4pV1k4JV0GovSfTqUddnrg\/viewform\"&gt;\u3053\u3061\u3089&lt;\/a&gt; \u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<\/strong>\r\n<strong>    &lt;\/p&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n<strong>&lt;!-- Modal --&gt;<\/strong>\r\n<strong>&lt;div class=\"modal fade\" id=\"game_over_modal\" tabindex=\"-1\" aria-labelledby=\"game_over_modal_label\" aria-hidden=\"true\"&gt;<\/strong>\r\n<strong>    &lt;div class=\"modal-dialog\"&gt;<\/strong>\r\n<strong>        &lt;div class=\"modal-content\"&gt;<\/strong>\r\n<strong>            &lt;div class=\"modal-header\"&gt;<\/strong>\r\n<strong>                &lt;h5 class=\"modal-title\" id=\"game_over_modal_label\"&gt;\u30b2\u30fc\u30e0\u30aa\u30fc\u30d0\u30fc...&amp;#x1F639;&lt;\/h5&gt;<\/strong>\r\n<strong>                &lt;button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"&gt;&lt;\/button&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div class=\"modal-body\"&gt;<\/strong>\r\n<strong>                \u518d\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3059\u304b\uff1f<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div class=\"modal-footer\"&gt;<\/strong>\r\n<strong>                &lt;button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\"&gt;\u3044\u3044\u3048&lt;\/button&gt;<\/strong>\r\n<strong>                &lt;a href=\"\" class=\"btn btn-primary\"&gt;\u306f\u3044&lt;\/a&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/@popperjs\/core@2.9.2\/dist\/umd\/popper.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.0.1\/dist\/js\/bootstrap.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/unpkg.com\/vue@3.2.31\/dist\/vue.global.prod.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/lodash@4.17.21\/lodash.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"\/js\/block_game_config.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script&gt;<\/strong>\r\n\r\n<strong>    const { createApp, ref, computed, nextTick } = Vue;<\/strong>\r\n\r\n<strong>    createApp({<\/strong>\r\n<strong>        setup() {<\/strong>\r\n\r\n<strong>            \/\/ \u5404\u7a2e\u8a2d\u5b9a<\/strong>\r\n<strong>            const rowLength = 13;<\/strong>\r\n<strong>            const columnLength = 8;<\/strong>\r\n\r\n<strong>            \/\/ \u30d6\u30ed\u30c3\u30af<\/strong>\r\n<strong>            const getInitialBlocks = (status = STATUS_EMPTY) =&gt; {<\/strong>\r\n\r\n<strong>                const blocks = [];<\/strong>\r\n\r\n<strong>                for(let y = 0; y &lt; rowLength; y++) {<\/strong>\r\n\r\n<strong>                    let rowBlocks = [];<\/strong>\r\n\r\n<strong>                    for(let x = 0; x &lt; columnLength; x++) {<\/strong>\r\n\r\n<strong>                        const center = false;<\/strong>\r\n<strong>                        rowBlocks.push({ x, y, status, center });<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    blocks.push(rowBlocks);<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                return blocks;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const allBlocks = ref(getInitialBlocks());<\/strong>\r\n<strong>            const setBlock = (x, y, status, center) =&gt; {<\/strong>\r\n\r\n<strong>                if(status !== null) {<\/strong>\r\n\r\n<strong>                    allBlocks.value[y][x].status = status;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                if(center !== null) {<\/strong>\r\n\r\n<strong>                    allBlocks.value[y][x].center = center;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const getBlock = (x, y) =&gt; {<\/strong>\r\n\r\n<strong>                if(x &gt;= 0 &amp;&amp; y &gt;= 0) {<\/strong>\r\n\r\n<strong>                    return allBlocks.value[y][x];<\/strong>\r\n\r\n<strong>                } else if(y &gt;= 0) {<\/strong>\r\n\r\n<strong>                    return allBlocks.value[y];<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                return allBlocks<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const getRowBlocks = y =&gt; {<\/strong>\r\n\r\n<strong>                return getBlock(-1, y);<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const resetBlock = (x, y) =&gt; {<\/strong>\r\n\r\n<strong>                setBlock(x, y, STATUS_EMPTY, false);<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const getBlockStyles = block =&gt; {<\/strong>\r\n\r\n<strong>                const backgroundColor = STATUS_COLORS[block.status];<\/strong>\r\n\r\n<strong>                return { backgroundColor };<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n\r\n<strong>            \/\/ \u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u90e8\u5206<\/strong>\r\n<strong>            const movingBlocks = computed(() =&gt; {<\/strong>\r\n\r\n<strong>                let blocks = [];<\/strong>\r\n\r\n<strong>                for(let y = 0; y &lt; rowLength; y++) {<\/strong>\r\n\r\n<strong>                    for(let x = 0; x &lt; columnLength; x++) {<\/strong>\r\n\r\n<strong>                        const block = getBlock(x, y);<\/strong>\r\n\r\n<strong>                        if(block.status === STATUS_MOVING) {<\/strong>\r\n\r\n<strong>                            blocks.push(block);<\/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 blocks;<\/strong>\r\n\r\n<strong>            });<\/strong>\r\n<strong>            const movingCenterBlock = computed(() =&gt; {<\/strong>\r\n\r\n<strong>                return movingBlocks.value.find(block =&gt; {<\/strong>\r\n\r\n<strong>                    return block.center === true;<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>            });<\/strong>\r\n<strong>            const isEmpty = block =&gt; {<\/strong>\r\n\r\n<strong>                return block.status === STATUS_EMPTY;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const isGameOver = () =&gt; {<\/strong>\r\n\r\n<strong>                const firstRowBlocks = getRowBlocks(0);<\/strong>\r\n\r\n<strong>                return firstRowBlocks.some(block =&gt; {<\/strong>\r\n\r\n<strong>                    return block.status !== STATUS_EMPTY;<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const shouldFix = () =&gt; {<\/strong>\r\n\r\n<strong>                for(let block of movingBlocks.value) {<\/strong>\r\n\r\n<strong>                    const { x, y } = block;<\/strong>\r\n<strong>                    const nextY = y + 1;<\/strong>\r\n\r\n<strong>                    if(y === rowLength - 1) { \/\/ \u5e95\u307e\u3067\u6765\u305f<\/strong>\r\n\r\n<strong>                        return true;<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    const downBlock = getBlock(x, nextY);<\/strong>\r\n\r\n<strong>                    if(downBlock.status === STATUS_FIXED) { \/\/ \u4e0b\u306e\u30d6\u30ed\u30c3\u30af\u304c\u56fa\u5b9a\u3055\u308c\u3066\u3044\u308b<\/strong>\r\n\r\n<strong>                        return true;<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                return false;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const dropMovingBlocks = () =&gt; {<\/strong>\r\n\r\n<strong>                let newMovingBlocks = [];<\/strong>\r\n\r\n<strong>                for(let block of movingBlocks.value) {<\/strong>\r\n\r\n<strong>                    const { x, y, center } = block;<\/strong>\r\n<strong>                    const nextY = y + 1;<\/strong>\r\n<strong>                    newMovingBlocks.push({<\/strong>\r\n<strong>                        x: x,<\/strong>\r\n<strong>                        y: nextY,<\/strong>\r\n<strong>                        status: STATUS_MOVING,<\/strong>\r\n<strong>                        center: center,<\/strong>\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                    resetBlock(x, y);<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                for(let block of newMovingBlocks) {<\/strong>\r\n\r\n<strong>                    const { x, y, status, center } = block;<\/strong>\r\n<strong>                    setBlock(x, y, status, center);<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            let currentMovingBlockType = null;<\/strong>\r\n<strong>            let currentMovingRotation = ROTATION_UP;<\/strong>\r\n<strong>            const getBlockMaps = (centerX, centerY, blockType, rotation) =&gt; {<\/strong>\r\n\r\n<strong>                const metadata = BLOCKS_METADATA[blockType];<\/strong>\r\n<strong>                const maps = metadata.maps[rotation];<\/strong>\r\n\r\n<strong>                let newMaps = [];<\/strong>\r\n\r\n<strong>                if(centerX === null) {<\/strong>\r\n\r\n<strong>                    centerX = metadata.center.x;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                if(centerY === null) {<\/strong>\r\n\r\n<strong>                    centerY = metadata.center.y;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                maps.forEach(map =&gt; {<\/strong>\r\n\r\n<strong>                    const { x, y, center } = map;<\/strong>\r\n<strong>                    const newX = centerX + x;<\/strong>\r\n<strong>                    const newY = centerY + y;<\/strong>\r\n\r\n<strong>                    newMaps.push({<\/strong>\r\n<strong>                        x: newX,<\/strong>\r\n<strong>                        y: newY,<\/strong>\r\n<strong>                        center: center<\/strong>\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>                return newMaps;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const addNewBlock = () =&gt; {<\/strong>\r\n\r\n<strong>                const types = Object.keys(BLOCKS_METADATA);<\/strong>\r\n<strong>                currentMovingBlockType = _.shuffle(types)[0]; \/\/ \u30e9\u30f3\u30c0\u30e0\u3067\u30d6\u30ed\u30c3\u30af\u53d6\u5f97<\/strong>\r\n<strong>                currentMovingRotation = ROTATION_UP;<\/strong>\r\n\r\n<strong>                const maps = getBlockMaps(null, null, currentMovingBlockType, currentMovingRotation);<\/strong>\r\n<strong>                maps.forEach(map =&gt; {<\/strong>\r\n\r\n<strong>                    const { x, y, center } = map;<\/strong>\r\n<strong>                    setBlock(x, y, STATUS_MOVING, center);<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const removedLines = ref(0);<\/strong>\r\n<strong>            const removeFullRowBlocks = () =&gt; { \/\/ \u63c3\u3063\u3066\u3044\u308c\u3070\u6d88\u3059<\/strong>\r\n\r\n<strong>                let fullRowIndexes = [];<\/strong>\r\n\r\n<strong>                for(let y = 0; y &lt; rowLength; y++) {<\/strong>\r\n\r\n<strong>                    const rowBlocks = getRowBlocks(y);<\/strong>\r\n<strong>                    const isFull = rowBlocks.every(block =&gt; {<\/strong>\r\n\r\n<strong>                        return block.status === STATUS_FIXED;<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                    if(isFull === true) { \/\/ \u63c3\u3063\u3066\u3044\u308b\u30e9\u30a4\u30f3\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97<\/strong>\r\n\r\n<strong>                        fullRowIndexes.push(y);<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                fullRowIndexes.forEach(fullIndex =&gt; {<\/strong>\r\n\r\n<strong>                    for(let y = fullIndex; y &gt; 0; y--) { \/\/ \u6d88\u3059\u30e9\u30a4\u30f3\u3088\u308a\u4e0a\u306b\u3042\u308b\u30d6\u30ed\u30c3\u30af\u3092\u4e00\u3064\u305a\u3064\u4e0b\u3052\u308b<\/strong>\r\n\r\n<strong>                        for(let x = 0; x &lt; columnLength; x++) {<\/strong>\r\n\r\n<strong>                            const prevY = y - 1;<\/strong>\r\n<strong>                            const prevBlock = getBlock(x, prevY);<\/strong>\r\n<strong>                            const status = prevBlock.status;<\/strong>\r\n<strong>                            setBlock(x, y, status, null);<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>                removedLines.value += fullRowIndexes.length;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            let gameOverModal = new bootstrap.Modal(document.getElementById('game_over_modal'));<\/strong>\r\n<strong>            const timer = setInterval(() =&gt; {<\/strong>\r\n\r\n<strong>                if(movingBlocks.value.length === 0) {<\/strong>\r\n\r\n<strong>                    addNewBlock();<\/strong>\r\n\r\n<strong>                } else {<\/strong>\r\n\r\n<strong>                    if(shouldFix()) {<\/strong>\r\n\r\n<strong>                        movingBlocks.value.forEach(movingBlock =&gt; {<\/strong>\r\n\r\n<strong>                            const { x, y } = movingBlock;<\/strong>\r\n<strong>                            setBlock(x, y, STATUS_FIXED, false);<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n\r\n<strong>                    } else {<\/strong>\r\n\r\n<strong>                        dropMovingBlocks();<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    removeFullRowBlocks();<\/strong>\r\n\r\n<strong>                    if(isGameOver()) {<\/strong>\r\n\r\n<strong>                        allBlocks.value = getInitialBlocks(STATUS_END);<\/strong>\r\n<strong>                        clearInterval(timer);<\/strong>\r\n\r\n<strong>                        setTimeout(() =&gt; {<\/strong>\r\n\r\n<strong>                            gameOverModal.show();<\/strong>\r\n\r\n<strong>                        }, 1000);<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            }, 300);<\/strong>\r\n\r\n<strong>            \/\/ \u64cd\u4f5c<\/strong>\r\n<strong>            const canMoveBlock = direction =&gt; {<\/strong>\r\n\r\n<strong>                for(let block of movingBlocks.value) {<\/strong>\r\n\r\n<strong>                    const { x, y } = block;<\/strong>\r\n<strong>                    const nextX = (direction === 'right')<\/strong>\r\n<strong>                        ? x + 1<\/strong>\r\n<strong>                        : x - 1;<\/strong>\r\n<strong>                    const nextBlock = allBlocks.value[y][nextX] || undefined;<\/strong>\r\n\r\n<strong>                    if(!nextBlock || nextBlock.status === STATUS_FIXED) {<\/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>                return true;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const moveBlock = direction =&gt; {<\/strong>\r\n\r\n<strong>                let newMovingBlocks = [];<\/strong>\r\n\r\n<strong>                if(canMoveBlock(direction)) {<\/strong>\r\n\r\n<strong>                    let centerLocation = {<\/strong>\r\n<strong>                        x: -1,<\/strong>\r\n<strong>                        y: -1<\/strong>\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    for(let block of movingBlocks.value) {<\/strong>\r\n\r\n<strong>                        const { x, y, center } = block;<\/strong>\r\n<strong>                        const nextX = (direction === 'right')<\/strong>\r\n<strong>                            ? x + 1<\/strong>\r\n<strong>                            : x - 1;<\/strong>\r\n<strong>                        newMovingBlocks.push(allBlocks.value[y][nextX]);<\/strong>\r\n\r\n<strong>                        if(center === true) {<\/strong>\r\n\r\n<strong>                            centerLocation = {<\/strong>\r\n<strong>                                x: nextX,<\/strong>\r\n<strong>                                y: y<\/strong>\r\n<strong>                            }<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                        resetBlock(x, y);<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    for(let block of newMovingBlocks) {<\/strong>\r\n\r\n<strong>                        const { x, y } = block;<\/strong>\r\n<strong>                        const center = (centerLocation.x === x &amp;&amp; centerLocation.y === y);<\/strong>\r\n\r\n<strong>                        setBlock(x, y, STATUS_MOVING, center);<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const canRotateBlock = newMaps =&gt; {<\/strong>\r\n\r\n<strong>                for(let map of newMaps) {<\/strong>\r\n\r\n<strong>                    const { x, y } = map;<\/strong>\r\n\r\n<strong>                    if(x &lt; 0 || x &gt;= columnLength || y &lt; 0 || y &gt;= rowLength) {<\/strong>\r\n\r\n<strong>                        return false;<\/strong>\r\n\r\n<strong>                    }<\/strong>\r\n\r\n<strong>                    const block = getBlock(x, y);<\/strong>\r\n\r\n<strong>                    if(! block || block.status === STATUS_FIXED) {<\/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>                return true;<\/strong>\r\n\r\n<strong>            };<\/strong>\r\n<strong>            const rotateBlock = () =&gt; {<\/strong>\r\n\r\n<strong>                currentMovingRotation = (currentMovingRotation + 1) % 2;<\/strong>\r\n<strong>                const block = movingCenterBlock.value;<\/strong>\r\n\r\n<strong>                if(block) {<\/strong>\r\n\r\n<strong>                    const newMaps = getBlockMaps(block.x, block.y, currentMovingBlockType, currentMovingRotation);<\/strong>\r\n\r\n<strong>                    if(canRotateBlock(newMaps)) {<\/strong>\r\n\r\n<strong>                        movingBlocks.value.forEach(block =&gt; {<\/strong>\r\n\r\n<strong>                            const { x, y } = block;<\/strong>\r\n<strong>                            resetBlock(x, y);<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n\r\n<strong>                        newMaps.forEach(map =&gt; {<\/strong>\r\n\r\n<strong>                            const { x, y, center } = map;<\/strong>\r\n<strong>                            setBlock(x, y, STATUS_MOVING, center);<\/strong>\r\n\r\n<strong>                        });<\/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 {<\/strong>\r\n<strong>                allBlocks,<\/strong>\r\n<strong>                getBlockStyles,<\/strong>\r\n<strong>                moveBlock,<\/strong>\r\n<strong>                rotateBlock,<\/strong>\r\n<strong>                isEmpty,<\/strong>\r\n<strong>                removedLines<\/strong>\r\n<strong>            }<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    }).mount('#app');<\/strong>\r\n\r\n<strong>&lt;\/script&gt;<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u30b2\u30fc\u30e0\u306e\u5b9a\u6570\u3084\u30d6\u30ed\u30c3\u30af\u306e\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\/js\/block_game_config.js<\/strong><\/p>\n<pre><strong>\/\/ \u5b9a\u6570\r\nconst STATUS_FIXED = 1;\r\nconst STATUS_MOVING = 2;\r\nconst STATUS_END = 3;\r\nconst STATUS_EMPTY = 0;\r\n\r\nconst STATUS_COLORS = {\r\n    0: '#fff',\r\n    1: '#99f',\r\n    2: '#f99',\r\n    3: '#ccc',\r\n};\r\n\r\nconst ROTATION_UP = 0;\r\nconst ROTATION_RIGHT = 1;\r\nconst ROTATION_DOWN = 2;\r\nconst ROTATION_LEFT = 3;\r\n\r\n\/\/ \u30d6\u30ed\u30c3\u30af\u306e\u5c5e\u6027\u60c5\u5831\r\nconst BLOCKS_METADATA = {\r\n    i: {\r\n        center: { x: 3, y: 0 },\r\n        maps: [\r\n            [\r\n                { x: 0, y: 0, center: false },\r\n                { x: 0, y: 1, center: true },\r\n                { x: 0, y: 2, center: false },\r\n            ],\r\n            [\r\n                { x: 0, y: 0, center: false },\r\n                { x: 1, y: 0, center: true },\r\n                { x: 2, y: 0, center: false },\r\n            ],\r\n        ]\r\n    },\r\n    l: {\r\n        center: { x: 3, y: 0 },\r\n        maps: [\r\n            [\r\n                { x: 0, y: 0, center: false },\r\n                { x: 0, y: 1, center: true },\r\n                { x: 1, y: 1, center: false },\r\n            ],\r\n            [\r\n                { x: 0, y: 0, center: false },\r\n                { x: 1, y: 0, center: true },\r\n                { x: 1, y: 1, center: false },\r\n            ],\r\n        ]\r\n    }\r\n};<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f\u30e1\u30a4\u30f3\u306e\u30b3\u30fc\u30c9\u306e\u4e2d\u3067\u91cd\u8981\u306a\u90e8\u5206\u3092\u30d4\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u3066\u3054\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30d6\u30ed\u30c3\u30af\u90e8\u5206<\/h2>\n<p>\u30d6\u30ed\u30c3\u30af\u90e8\u5206\u306f\u5148\u307b\u3069\u8a00\u53ca\u3057\u307e\u3057\u305f\u3088\u3046\u306b\u3001\u300c<strong>\u914d\u5217\u3092\u3064\u304f\u3063\u3066\u3001\u4e2d\u8eab\u306e\u30c7\u30fc\u30bf\u3092\u5909\u66f4\u3059\u308b<\/strong>\u300d\u3053\u3068\u3067\u7ba1\u7406\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u3059\u308b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<td>2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u306a\u304a\u3001\u5404\u30de\u30b9\u76ee\u306e\u30c7\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u7ba1\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>x\uff1a \u6a2a\u306e\u4f4d\u7f6e<\/li>\n<li>y\uff1a \u7e26\u306e\u4f4d\u7f6e<\/li>\n<li>status\uff1a \u72b6\u614b\uff080 = \u7a7a\u30011 = \u56fa\u5b9a\u3057\u3066\u3044\u308b\u30012 = \u52d5\u3044\u3066\u3044\u308b\u30013 = \u7d42\u4e86\uff09<\/li>\n<li>center\uff1a \u56de\u8ee2\u3059\u308b\u4e2d\u5fc3<\/li>\n<\/ul>\n<p>\u57fa\u672c\u7684\u306b\u306f\u305d\u306e\u4ed6\u306e\u90e8\u5206\u3067\u3082\u3001\u3053\u306e\u914d\u5217\u3092\u5909\u66f4\u3059\u308b\u3082\u306e\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u90e8\u5206<\/h2>\n<p>\u3053\u3053\u3067\u306f\u30d6\u30ed\u30c3\u30af\u304c\u843d\u3061\u3066\u3044\u304f\u90e8\u5206\u3092\u7ba1\u7406\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u306f\u7e70\u308a\u8fd4\u3057\u540c\u3058\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001<code>setInterval()<\/code>\u5185\u3067\uff08\u4eca\u56de\u306f\uff11\u79d2\u3054\u3068\u306b\uff09\u30af\u30eb\u30af\u30eb\u56de\u3063\u3066\u3044\u308b\u72b6\u614b\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u5b9f\u884c\u3059\u308b\u9806\u5e8f\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u65b0\u3057\u3044\u30d6\u30ed\u30c3\u30af\u3092\u8ffd\u52a0<\/li>\n<li>\u30d6\u30ed\u30c3\u30af\u3092\u843d\u4e0b\u3055\u305b\u308b\uff08\u914d\u5217\u306e\u72b6\u614b\u3092\u5909\u66f4\u3059\u308b\uff09<\/li>\n<li>\u5e95\u307e\u3067\u884c\u3063\u305f\u308a\u3001\u4e0b\u306b\u56fa\u5b9a\u6e08\u307f\u306e\u30d6\u30ed\u30c3\u30af\u304c\u5b58\u5728\u3057\u3066\u3044\u305f\u3089\u3001\u305d\u3053\u3067\u30b9\u30c8\u30c3\u30d7\u3057\u3001\u72b6\u614b\u3092\u300c\u52d5\u3044\u3066\u3044\u308b \u2192 \u56fa\u5b9a\u300d\u3078\u5909\u66f4\u3059\u308b<\/li>\n<li>\u305d\u3057\u3066\u3001\u30d6\u30ed\u30c3\u30af\u304c\u4e00\u756a\u4e0a\u307e\u3067\u6765\u3066\u3057\u307e\u3063\u305f\u3089\u300c\u30b2\u30fc\u30e0\u30aa\u30fc\u30d0\u30fc\u300d\u306b\u306a\u308b<\/li>\n<\/ol>\n<p>\u306a\u304a\u3001\u3053\u306e\u4e2d\u3067\u4e00\u756a\u96e3\u3057\u304b\u3063\u305f\u306e\u304c\u3001\u30d6\u30ed\u30c3\u30af\u304c\u6a2a\u4e00\u5217\u306b\u63c3\u3063\u305f\u6642\uff08\uff1d\u6d88\u3059\u6642\uff09\u306e\u6319\u52d5\u3067\u3059\u3002\u6d88\u3057\u305f\u5f8c\u306f\uff08\u91cd\u529b\u306b\u3057\u305f\u304c\u3063\u3066\uff09\u305d\u306e\u4e0a\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u30d6\u30ed\u30c3\u30af\u3092\u9806\u756a\u306b\u4e0b\u3078\u79fb\u52d5\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5834\u5408\u3060\u3068\u3001<\/p>\n<p>\u25a1\u25a1\u25a1<br \/>\n\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0 \u2190 \u63c3\u3063\u305f\u2728<br \/>\n\u25a0\u25a0\u25a0\u25a0\u25a1\u25a1\u25a0\u25a0\u25a0<br \/>\n\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0\u25a0 \u2190 \u63c3\u3063\u305f\u2728<\/p>\n<p>\uff12\u884c\u76ee\u3068\uff14\u884c\u76ee\u304c\u524a\u9664\u3055\u308c\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3089\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u25a1\u25a1\u25a1<br \/>\n\u25a0\u25a0\u25a0\u25a0\u25a1\u25a1\u25a0\u25a0\u25a0<\/p>\n<p>\u305d\u3053\u3067\u3001\u63c3\u3063\u305f\u884c\u3092\u53d6\u5f97\u3057\u3066\uff11\u3064\u305a\u3064\u884c\u3092\u79fb\u52d5\uff08\u914d\u5217\u306e\u72b6\u614b\u3092\u5909\u66f4\uff09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u64cd\u4f5c<\/h2>\n<p>\u3053\u3053\u3067\u306f\u300c<strong>\u843d\u4e0b\u3057\u3066\u3044\u308b\u30d6\u30ed\u30c3\u30af<\/strong>\u300d\u306e\u5de6\u53f3\u3001\u56de\u8ee2\u3055\u305b\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p>\u5de6\u53f3\u306e\u79fb\u52d5\u3082\u305d\u3046\u306a\u306e\u3067\u3059\u304c\u3001\u5148\u307b\u3069\u3082\u66f8\u3044\u305f\u3088\u3046\u306b\u56de\u8ee2\u3059\u308b\u90e8\u5206\u304c\u624b\u3053\u305a\u308a\u307e\u3057\u305f\u2026\ud83d\ude2b<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u300c<strong>\u3069\u3053\u304c\u57fa\u6e96\u306b\u306a\u3063\u3066\u56de\u8ee2\u3059\u308b\u306e\u304b\uff1f<\/strong>\u300d\u3068\u3044\u3046\u30c7\u30fc\u30bf\u3092\u5e38\u306b\u6301\u305f\u305b\u3066\u304a\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u304b\u3063\u305f\u304b\u3089\u3067\u3059\u3002\uff08\u305d\u308c\u304c\u3001\u5404\u914d\u5217\u5185\u306e<code>center<\/code>\u306b\u306a\u308a\u307e\u3059\uff09<\/p>\n<p>\u5f53\u521d\u306f\u30d6\u30ed\u30c3\u30af\u306e\u5f62\u72b6\u304b\u3089\u56de\u8ee2\u3067\u304d\u308b\u3060\u308d\u3046\u3068\u7c21\u5358\u306b\u8003\u3048\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u300c<strong>\u56de\u8ee2\u3059\u308b\uff1d\u79fb\u52d5\u3059\u308b\u65b9\u5411\u304c\u6bce\u56de\u5909\u308f\u308b<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001\u305d\u3082\u305d\u3082\u7121\u7406\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u56de\u8ee2\u3057\u305f\u72b6\u614b\u306e\u30d6\u30ed\u30c3\u30af\u3092<code>block_game_config.js<\/code>\u306e\u4e2d\u306b\u5168\u3066\u6e96\u5099\u3057\u3001\u3055\u3089\u306b\u56de\u8ee2\u72b6\u614b\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3082\u4fdd\u6301\u3059\u308b\u3053\u3068\u3067\u6b21\u3005\u3068\u56de\u8ee2\u3055\u305b\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u672c\u5bb6\u306f\u3069\u3046\u3084\u3063\u3066\u56de\u8ee2\u3055\u305b\u3066\u308b\u3093\u3067\u3057\u3087\u3046\u306d \ud83e\udd14\uff09<\/p>\n<h2>Safari \u306e\u30c0\u30d6\u30eb\u30bf\u30c3\u30d7\u3092\u7121\u52b9\u306b\u3059\u308b<\/h2>\n<p><code>iPhone<\/code>\uff08<code>iOS 15.5<\/code>\uff09\u3067\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u30c0\u30d6\u30eb\u30bf\u30c3\u30d7\u3059\u308b\u3054\u3068\u306b\u753b\u9762\u30d5\u30a9\u30fc\u30ab\u30b9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3057\u307e\u3044\u30b2\u30fc\u30e0\u3069\u3053\u308d\u3067\u306f\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306e<code>CSS<\/code>\u3092\u30dc\u30bf\u30f3\u306b\u30bb\u30c3\u30c8\u3057\u3066\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>.disable-dbl-tap-zoom {<\/strong>\r\n\r\n<strong>    touch-action: manipulation;<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<pre>&lt;button class=\"btn btn-primary btn-lg me-3 <strong>disable-dbl-tap-zoom<\/strong>\" @click=\"moveBlock('left')\"&gt;\u2190&lt;\/button&gt;<\/pre>\n<h2>\u914d\u5217\u5185\u306e\u5024\u3092\u305a\u3089\u3057\u306a\u304c\u3089\u53d6\u5f97\u3059\u308b\u7701\u30b3\u30fc\u30c9<\/h2>\n<p>\u4eca\u56de\u3044\u308d\u3044\u308d\u3068\u8abf\u3079\u7269\u3092\u3057\u3066\u3044\u3066\u300c\u306a\u308b\u307b\u3069\uff01\u300d\u3068\u601d\u3063\u305f\u306e\u304c\u300c<strong>\u914d\u5217\u304b\u3089\u305a\u3089\u3057\u306a\u304c\u3089\u5024\u3092\u53d6\u5f97\u3059\u308b<\/strong>\u300d\u7701\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u914d\u5217\u304c\u3042\u3063\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>const names = [<\/strong>\r\n<strong>    '\u592a\u90ce',<\/strong>\r\n<strong>    '\u6b21\u90ce',<\/strong>\r\n<strong>    '\u4e09\u90ce',<\/strong>\r\n<strong>    '\u56db\u90ce'<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u4eca\u304b\u308910\u56de\u30eb\u30fc\u30d7\u3059\u308b\u4e2d\u3067\u3001\u300c<strong>\u592a\u90ce<\/strong>\u300d\u2192\u300c<strong>\u6b21\u90ce<\/strong>\u300d\u2192\u300c<strong>\u4e09\u90ce<\/strong>\u300d\u2192\u300c<strong>\u56db\u90ce<\/strong>\u300d\u2192\u300c<strong>\uff08\u307e\u305f\uff09\u592a\u90ce<\/strong>\u300d&#8230;.<\/p>\n<p>\u3068\u3044\u3046\u98a8\u306b\u7121\u9650\u306b\u6b21\u306e\u30c7\u30fc\u30bf\u3092\u305a\u3089\u3057\u306a\u304c\u3089\u53d6\u5f97\u3059\u308b\u3068\u3044\u3046\u5834\u5408\u3067\u3059\u3002<\/p>\n<p>\u6700\u521d\u306b\u601d\u3044\u3064\u304f\u306e\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>if<\/code>\u6587\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u521d\u671f\u5316\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<pre><strong>let nameIndex = 0;<\/strong>\r\n\r\n<strong>for(let i = 0 ; i &lt; 10 ; i++) {<\/strong>\r\n\r\n<strong>    if(names[nameIndex] === undefined) {<\/strong>\r\n\r\n<strong>        nameIndex = 0; \/\/ \ud83d\udc48 \u3053\u3053\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u521d\u671f\u5316<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    console.log(names[nameIndex]);<\/strong>\r\n\r\n<strong>    nameIndex++;<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3082\u3061\u308d\u3093\u3053\u308c\u3067\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u305f\u3063\u305f\uff14\u884c\u3067\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>for(let i = 0 ; i &lt; 10 ; i++) {<\/strong>\r\n\r\n<strong>    const nameIndex = i % names.length; \/\/ \ud83d\udc48 \u3053\u3053<\/strong>\r\n<strong>    console.log(names[nameIndex]);<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3064\u307e\u308a\u3001\u300c<strong>\u3042\u3075\u308c\u305f\u5206\u306e\u3042\u307e\u308a\uff1d\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/strong>\u300d\u306b\u3059\u308b\u3053\u3068\u3067\u30b7\u30f3\u30d7\u30eb\u306b\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u306d\u3002\u3057\u304b\u3082\u53ef\u8aad\u6027\u3082\u3053\u3061\u3089\u306e\u65b9\u304c\u3088\u304f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3084\u306f\u308a\u8ce2\u3044\u4eba\u305f\u3061\u306f\u3059\u3054\u3044\u3067\u3059\u306d \ud83d\ude0a\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p><code>Vue<\/code>\u3092\u4f7f\u3046\u3068\u3001\u901a\u5e38\u306e\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u4eca\u56de\u306e\u3088\u3046\u306a\u30b2\u30fc\u30e0\u307e\u3067\u5e45\u5e83\u304f\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u4f55\u304b\u300c<strong>\u3053\u3093\u306a\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3060\u308d\u3046\u304b\uff1f<\/strong>\u300d\u3068\u3044\u3046\u30a2\u30a4\u30c7\u30a2\u304c\u3054\u3056\u3044\u307e\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306e\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Vue 3<\/code>\u3067\u300c\u3042\u306e\u300d\u843d\u3061\u3082\u306e\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u79c1\u304c\u521d\u3081\u3066\u672c\u5bb6\u306e\u30b2\u30fc\u30e0\u3092\u3084\u3063\u305f\u306e\u306f\u5c0f\u5b66\u751f\u306e\u9803\u3067\u3001\u300c<strong>\u3053\u3093\u306a\u306b\u5358\u7d14\u306a\u306e\u306b\u306a\u3093\u3066\u9762\u767d\u3044\u30b2\u30fc\u30e0\u306a\u3093\u3060\uff01<\/strong>\u300d\u3068\u611f\u9298\u3092\u53d7\u3051\u305f\u3053\u3068\u3092\u899a\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\uff08\u5e74\u304c\u30d0\u30ec\u307e\u3059\u304c\uff09\u5f53\u6642\u306f\u300cBPS\u300d\u3068\u3044\u3046\u805e\u3044\u305f\u3053\u3068\u3082\u306a\u3044\u4f1a\u793e\u304b\u3089\u767a\u58f2\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u306a\u3093\u3068\u3053\u306e\u30bd\u30d5\u30c8\u3067\u306f\u300c\u3061\u3087\u3063\u3068\u305a\u3064\u843d\u4e0b\u30b9\u30d4\u30fc\u30c9\u3092\u3042\u3052\u308b\u300d\u3053\u3068\u304c\u3067\u304d\u305a\u3001\u3044\u304d\u306a\u308a\u4e00\u756a\u4e0b\u307e\u3067\u30c9\u30ab\u30f3\u3068\u79fb\u52d5\u3057\u3066\u3057\u307e\u3044\u3001\u300c<strong>\u3046\u308f\u30fc\u3001\uff11\u500b\u305a\u308c\u3066\u305f\u3058\u3083\u3093\ud83d\ude2b<\/strong>\u300d\u3068\u306a\u3063\u305f\u306e\u306f\u3044\u3044\u60f3\u3044\u51fa\u3067\u3059\uff08\u7b11\uff09<\/p>\n<p>\u4eca\u56de\u306f\u843d\u4e0b\u30b9\u30d4\u30fc\u30c9\u306e\u90e8\u5206\u306f\u3064\u304f\u3063\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u3053\u308c\u3082\u5b9f\u88c5\u3059\u308b\u3068\u306a\u308b\u3068<code>setInterval()<\/code>\u307e\u308f\u308a\u3092\u6539\u5909\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u306a\u304b\u306a\u304b\u96e3\u3057\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305d\u3046\u8003\u3048\u308b\u3068\u3001\u305d\u306e\u6614\u300c<strong>\u3053\u306e\u30af\u30bd\u30b2\u30fc\u304c\uff01<\/strong>\u300d\u3068\u3088\u304f\u8a00\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u958b\u767a\u8005\u76ee\u7dda\u3067\u3044\u304f\u3068\u3001\u3059\u3070\u3089\u3057\u3044\u4f5c\u54c1\u3070\u304b\u308a\u3060\u3063\u305f\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305c\u3072\u3001\u307f\u306a\u3055\u3093\u3082\u7ae5\u5fc3\u306b\u5e30\u3063\u3066\u4f55\u304b\u3064\u304f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10758 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/06\/no_21.png\" alt=\"\" width=\"370\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/06\/no_21.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/06\/no_21-300x259.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300cApple \u3055\u3093\u3001\u3082\u3046 Safari \u3082<br \/>\nChrome \u30d9\u30fc\u30b9\u306b\u3057\u307e\u305b\u3093\u304b\u2026\ud83d\ude02\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u7686\u3055\u3093\u3082\u5b63\u7bc0\u304c\u5909\u308f\u308b\u3068\u5370\u8c61\u6df1\u3044\u3053\u3068\u3092\u601d\u3044\u51fa\u3059\u3053\u3068\u3082\u3042\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002\u3061\u306a\u307f\u306b\u79c1\u306e\u5834\u5408\u3001\u6691\u3044\u590f\u306f\u3001 \u300c\u590f\u4f11\u307f\u306e\u5bbf\u984c\u3067\u3084\u3063\u305f\u81ea\u7531\u7814\u7a76\u304c\u697d\u3057\u304b\u3063\u305f\u300d &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=10784\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Vue 3 \u3067\u3042\u306e\u300c\u843d\u3061\u3082\u306e\u30d1\u30ba\u30eb\u30b2\u30fc\u30e0\u300d\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":10789,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-10784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vue-js"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10784","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=10784"}],"version-history":[{"count":3,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10784\/revisions"}],"predecessor-version":[{"id":10788,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10784\/revisions\/10788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/10789"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}