{"id":181,"date":"2025-04-29T13:50:21","date_gmt":"2025-04-29T04:50:21","guid":{"rendered":"https:\/\/suyasuyahirohiro.com\/?p=181"},"modified":"2025-04-29T13:50:21","modified_gmt":"2025-04-29T04:50:21","slug":"%e6%a9%9f%e8%83%bd%e3%81%94%e3%81%a8%e3%81%ab%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e5%88%86%e3%81%91%e3%82%8b","status":"publish","type":"post","link":"https:\/\/suyasuyahirohiro.com\/?p=181","title":{"rendered":"\u6a5f\u80fd\u3054\u3068\u306b\u30da\u30fc\u30b8\u3092\u5206\u3051\u308b"},"content":{"rendered":"\n<p>\u73fe\u5834\uff11\u753b\u9762\u306b\u96c6\u7d04\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u305f\u3081<br>\u6a5f\u80fd\u3054\u3068\u306b\u30da\u30fc\u30b8\u3092\u5206\u3051\u3066\u3044\u304d\u307e\u3059<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"378\" src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-28-13.32.21-1024x378.png\" alt=\"\" class=\"wp-image-182\" srcset=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-28-13.32.21-1024x378.png 1024w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-28-13.32.21-300x111.png 300w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-28-13.32.21-768x283.png 768w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-28-13.32.21-1536x567.png 1536w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-04-28-13.32.21-2048x756.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff12\uff1a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a<\/strong><\/p>\n\n\n\n<p><code>src<\/code> \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b <code>router<\/code> \u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u4e2d\u306b <code>index.js<\/code> \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong><code>src\/router\/index.js<\/code> \u306e\u8a18\u8ff0:<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { createRouter, createWebHistory } from \"vue-router\";\nimport PomodoroTimer from \"..\/components\/PomodoroTimer.vue\";\nimport PomodoroCalendar from \"..\/components\/PomodoroCalendar.vue\";\n\nconst routes = &#91;\n  {\n    path: \"\/\",\n    name: \"Home\",\n    component: PomodoroTimer,\n  },\n  {\n    path: \"\/calendar\",\n    name: \"Calendar\",\n    component: PomodoroCalendar,\n  },\n];\n\nconst router = createRouter({\n  history: createWebHistory(),\n  routes,\n});\n\nexport default router;\n\n<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>createRouter<\/code> \u3068 <code>createWebHistory<\/code> \u3092 Vue Router \u304b\u3089\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<code>createWebHistory()<\/code> \u306f\u30d6\u30e9\u30a6\u30b6\u306e\u5c65\u6b74 API \u3092\u4f7f\u7528\u3057\u305f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30e2\u30fc\u30c9\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>PomodoroTimer.vue<\/code> \u3068 <code>PomodoroCalendar.vue<\/code> \u3092\u305d\u308c\u305e\u308c\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30d1\u30b9\u304b\u3089\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>routes<\/code> \u914d\u5217\u3067\u30d1\u30b9\u3068\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u5bfe\u5fdc\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002\n<ul class=\"wp-block-list\">\n<li><code>\/<\/code> \u30d1\u30b9\u306b\u306f <code>PomodoroTimer<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5272\u308a\u5f53\u3066\u3001\u540d\u524d\u3092 <code>Home<\/code> \u3068\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u30c8\u30c3\u30d7\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>\/calendar<\/code> \u30d1\u30b9\u306b\u306f <code>PomodoroCalendar<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5272\u308a\u5f53\u3066\u3001\u540d\u524d\u3092 <code>Calendar<\/code> \u3068\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u30ab\u30ec\u30f3\u30c0\u30fc\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>createRouter<\/code> \u95a2\u6570\u306b <code>history<\/code> \u3068 <code>routes<\/code> \u3092\u6e21\u3057\u3066\u30eb\u30fc\u30bf\u30fc\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u4f5c\u6210\u3057\u305f\u30eb\u30fc\u30bf\u30fc\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092 <code>export default router;<\/code> \u3067\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff13\uff1a<code>main.js<\/code> \u306e\u4fee\u6b63<\/strong><\/p>\n\n\n\n<p>\u4f5c\u6210\u3057\u305f\u30eb\u30fc\u30bf\u30fc\u3092 Vue \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u7d44\u307f\u8fbc\u3080\u305f\u3081\u306b\u3001<code>src\/main.js<\/code> \u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong><code>src\/main.js<\/code> \u306e\u4fee\u6b63:<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { createApp } from \"vue\";\nimport App from \".\/App.vue\";\n\nimport router from \".\/router\"; \/\/ \u30eb\u30fc\u30bf\u30fc\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\n\nconst app = createApp(App);\napp.use(router); \/\/ \u30eb\u30fc\u30bf\u30fc\u3092 Vue \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u767b\u9332\napp.mount(\"#app\");\n<\/code><\/pre>\n\n\n\n<p><strong>\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>import router from '.\/router';<\/code> \u3067\u4f5c\u6210\u3057\u305f\u30eb\u30fc\u30bf\u30fc\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>app.use(router);<\/code> \u3067 Vue \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u30eb\u30fc\u30bf\u30fc\u3092\u767b\u9332\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001<code>&lt;router-link><\/code> \u3084 <code>&lt;router-view><\/code> \u306a\u3069\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u95a2\u9023\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff14\uff1a<code>App.vue<\/code> \u306e\u4fee\u6b63<\/strong><\/p>\n\n\n\n<p><code>App.vue<\/code> \u3092\u4fee\u6b63\u3057\u3066\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u5207\u308a\u66ff\u3048\u3092\u884c\u3046\u305f\u3081\u306e <code>&lt;router-view&gt;<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3068\u3001\u753b\u9762\u9077\u79fb\u306e\u305f\u3081\u306e\u30ea\u30f3\u30af <code>&lt;router-link&gt;<\/code> \u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong><code>src\/App.vue<\/code> \u306e\u4fee\u6b63:<\/strong><\/p>\n\n\n\n<p>HTML<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template&gt;\n  &lt;div&gt;\n    &lt;nav&gt;\n      &lt;router-link to=\"\/\"&gt;\u30bf\u30a4\u30de\u30fc&lt;\/router-link&gt; |\n      &lt;router-link to=\"\/calendar\"&gt;\u30ab\u30ec\u30f3\u30c0\u30fc&lt;\/router-link&gt;\n    &lt;\/nav&gt;\n    &lt;router-view&gt;&lt;\/router-view&gt;\n  &lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;script&gt;\nexport default {\n  name: 'App',\n};\n&lt;\/script&gt;\n\n&lt;style&gt;\n#app {\n  font-family: Avenir, Helvetica, Arial, sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  text-align: center;\n  color: #2c3e50;\n  margin-top: 60px;\n}\n\nnav {\n  padding: 30px;\n}\n\nnav a {\n  font-weight: bold;\n  color: #2c3e50;\n  text-decoration: none;\n}\n\nnav a.router-link-exact-active {\n  color: #42b983;\n}\n&lt;\/style&gt;\n<\/code><\/pre>\n\n\n\n<p><strong><sup>1 <\/sup>\u89e3\u8aac:<\/strong> &nbsp;<\/p>\n\n\n\n<p><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\"><\/a><\/p>\n\n\n\n<p><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\">1. github.com <\/a><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\"><\/a><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\"><\/a><\/p>\n\n\n\n<p><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\"><\/a><\/p>\n\n\n\n<p><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\">github.com<\/a><a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/Costin-c\/KuChe\"><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;nav><\/code> \u30bf\u30b0\u5185\u306b\u3001<code>&lt;router-link to=\"\/\">\u30bf\u30a4\u30de\u30fc&lt;\/router-link><\/code> \u3068 <code>&lt;router-link to=\"\/calendar\">\u30ab\u30ec\u30f3\u30c0\u30fc&lt;\/router-link><\/code> \u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002\n<ul class=\"wp-block-list\">\n<li><code>&lt;router-link to=\"...\"><\/code> \u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u30d1\u30b9\u3078\u306e\u30ea\u30f3\u30af\u3092\u751f\u6210\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3059\u3002\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001Vue Router \u304c\u5bfe\u5fdc\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>to=\"\/\"<\/code>: \u30eb\u30fc\u30c8\u30d1\u30b9\uff08\u30c8\u30c3\u30d7\u753b\u9762\uff09\u3078\u306e\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>to=\"\/calendar\"<\/code>: <code>\/calendar<\/code> \u30d1\u30b9\uff08\u30ab\u30ec\u30f3\u30c0\u30fc\u753b\u9762\uff09\u3078\u306e\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><code>&lt;router-view>&lt;\/router-view><\/code>: \u73fe\u5728\u306e\u30eb\u30fc\u30c8\u306b\u5bfe\u5fdc\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u308b\u5834\u6240\u3067\u3059\u3002URL \u304c <code>\/<\/code> \u3067\u3042\u308c\u3070 <code>PomodoroTimer<\/code> \u304c\u3001<code>\/calendar<\/code> \u3067\u3042\u308c\u3070 <code>PomodoroCalendar<\/code> \u304c\u3053\u3053\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>&lt;style><\/code> \u30bf\u30b0\u3067\u306f\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30bf\u30a4\u30eb\u3068\u3001\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30ea\u30f3\u30af\u306e\u30b9\u30bf\u30a4\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4e0a\u8a18\u306e\u7de8\u96c6\u3092\u884c\u3063\u305f\u3053\u3068\u3067\u30da\u30fc\u30b8\u3092\u9077\u79fb\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/04\/\u753b\u9762\u53ce\u9332-2025-04-28-13.45.19.mov\"><\/video><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8ffd\u52a0\u3000-\u30ab\u30ec\u30f3\u30c0\u30fc\u753b\u9762\u3067\u30bf\u30a4\u30de\u30fc\u3092\u975e\u8868\u793a\u306b\u3059\u308b<\/h3>\n\n\n\n<p><strong>\u4fee\u6b63\u65b9\u91dd:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>App.vue<\/code> \u3067\u4f5c\u696d\u7d42\u4e86\u6642\u306b\u53d7\u3051\u53d6\u3063\u305f\u30ed\u30b0\u3092 <code>calendarWorkLogs<\/code> \u306b\u4fdd\u6301\u3059\u308b\u3002<\/strong><\/li>\n\n\n\n<li><strong><code>PomodoroCalendar<\/code> \u3067 <code>props<\/code> \u306e <code>workLogs<\/code> \u3092\u76e3\u8996\u3057\u3001\u5909\u66f4\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u5185\u90e8\u306e <code>calendarWorkLogs<\/code> \u3092\u66f4\u65b0\u3059\u308b\u3002<\/strong> \u3053\u308c\u306b\u3088\u308a\u3001<code>App.vue<\/code> \u304b\u3089\u6e21\u3055\u308c\u305f\u65b0\u3057\u3044\u30ed\u30b0\u304c\u30ab\u30ec\u30f3\u30c0\u30fc\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u8ffd\u52a0\u524d\u306e\u30b3\u30fc\u30c9 (<code>App.vue<\/code> \u306e <code>&lt;script&gt;<\/code> \u90e8\u5206):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import PomodoroTimer from \".\/components\/PomodoroTimer.vue\";\nimport PomodoroCalendar from \".\/components\/PomodoroCalendar.vue\";\nimport { useRoute } from \"vue-router\";\nimport { ref } from \"vue\";\n\nexport default {\n  name: \"App\",\n  components: {\n    PomodoroTimer,\n    PomodoroCalendar,\n  },\n  setup() {\n    const route = useRoute();\n    const calendarRef = ref(null); \/\/ PomodoroCalendar \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u53c2\u7167\n    const calendarWorkLogs = ref(&#91;]); \/\/ (\u4e00\u65e6\u4fdd\u6301\u7528\u3068\u3057\u3066\u6b8b\u3057\u307e\u3059\u304c\u3001\u76f4\u63a5\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3076\u305f\u3081\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093)\n\n    const handleWorkFinished = (logData) =&gt; {\n      console.log(\"App.vue \u3067\u4f5c\u696d\u7d42\u4e86\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308a\u307e\u3057\u305f:\", logData);\n      if (route.path === \"\/calendar\" &amp;&amp; calendarRef.value) {\n        calendarRef.value.addWorkLog(logData); \/\/ \u30ab\u30ec\u30f3\u30c0\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e addWorkLog \u3092\u76f4\u63a5\u547c\u3073\u51fa\u3059\n      } else {\n        calendarWorkLogs.value.push(logData); \/\/ \u30ab\u30ec\u30f3\u30c0\u30fc\u304c\u975e\u8868\u793a\u306e\u5834\u5408\u306f\u4e00\u65e6\u4fdd\u6301\n      }\n    };\n\n    return { route, calendarRef, calendarWorkLogs, handleWorkFinished };\n  },\n  mounted() {\n    \/\/ \u30da\u30fc\u30b8\u30ed\u30fc\u30c9\u6642\u3084\u753b\u9762\u9077\u79fb\u6642\u306b\u3001\u4fdd\u6301\u3057\u3066\u3044\u308b\u30ed\u30b0\u3092\u30ab\u30ec\u30f3\u30c0\u30fc\u306b\u53cd\u6620\n    this.$watch(\n      () =&gt; this.$route.path,\n      (newPath) =&gt; {\n        if (\n          newPath === \"\/calendar\" &amp;&amp;\n          this.calendarRef &amp;&amp;\n          this.calendarWorkLogs.value.length &gt; 0\n        ) {\n          this.calendarWorkLogs.value.forEach((log) =&gt; {\n            this.calendarRef.addWorkLog(log);\n          });\n          this.calendarWorkLogs.value = &#91;]; \/\/ \u53cd\u6620\u5f8c\u306b\u30af\u30ea\u30a2\n        }\n      },\n      {} \/\/ \u30a6\u30a9\u30c3\u30c1\u30e3\u30fc\u30aa\u30d7\u30b7\u30e7\u30f3\uff08\u4eca\u56de\u306f\u4e0d\u8981\u3067\u3059\u304c\u3001Prettier\u306e\u6574\u5f62\u306b\u5408\u308f\u305b\u3066\u8a18\u8ff0\uff09\n    );\n  },\n};\n<\/code><\/pre>\n\n\n\n<p><strong>\u8ffd\u52a0\u5f8c\u306e\u30b3\u30fc\u30c9 (<code>App.vue<\/code> \u306e <code>&lt;script&gt;<\/code> \u90e8\u5206):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import PomodoroTimer from \".\/components\/PomodoroTimer.vue\";\nimport PomodoroCalendar from \".\/components\/PomodoroCalendar.vue\";\nimport { useRoute } from \"vue-router\";\nimport { ref } from \"vue\";\n\nexport default {\n  name: \"App\",\n  components: {\n    PomodoroTimer,\n    PomodoroCalendar,\n  },\n  setup() {\n    const route = useRoute();\n    const calendarWorkLogs = ref(&#91;]); \/\/ \u30ab\u30ec\u30f3\u30c0\u30fc\u306b\u6e21\u3059\u4f5c\u696d\u30ed\u30b0\n\n    const handleWorkFinished = (logData) =&gt; {\n      console.log(\"App.vue \u3067\u4f5c\u696d\u7d42\u4e86\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308a\u307e\u3057\u305f:\", logData);\n      calendarWorkLogs.value.push(logData); \/\/ \u4f5c\u696d\u7d42\u4e86\u6642\u306b\u30ed\u30b0\u3092 calendarWorkLogs \u306b\u8ffd\u52a0\n    };\n\n    return { route, calendarWorkLogs, handleWorkFinished };\n  },\n};\n<\/code><\/pre>\n\n\n\n<p><strong>\u8ffd\u52a0\u5f8c\u306e\u30b3\u30fc\u30c9 (<code>PomodoroCalendar.vue<\/code> \u306e <code>&lt;script&gt;<\/code> \u90e8\u5206):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export default {\n  name: \"PomodoroCalendar\",\n  props: {\n    workLogs: {\n      type: Array,\n      default: () =&gt; &#91;],\n    },\n  },\n  data() {\n    const today = new Date();\n    const currentYear = today.getFullYear();\n    const currentMonth = today.getMonth() + 1;\n    return {\n      year: currentYear,\n      month: currentMonth,\n      daysOfWeek: &#91;\"\u65e5\", \"\u6708\", \"\u706b\", \"\u6c34\", \"\u6728\", \"\u91d1\", \"\u571f\"],\n      todayDate: today.getDate(),\n      todayMonth: currentMonth,\n      todayYear: currentYear,\n      calendarWorkLogs: &#91;...this.workLogs], \/\/ props \u306e\u5024\u3092\u521d\u671f\u5024\u3068\u3057\u3066\u4f7f\u7528\n    };\n  },\n  watch: {\n    workLogs(newWorkLogs) {\n      this.calendarWorkLogs = &#91;...newWorkLogs]; \/\/ props \u304c\u66f4\u65b0\u3055\u308c\u305f\u3089 data \u3082\u66f4\u65b0\n    },\n  },\n  computed: {\n    daysInMonth() {\n      return new Date(this.year, this.month, 0).getDate();\n    },\n    firstDayOfMonth() {\n      return new Date(this.year, this.month - 1, 1).getDay();\n    },\n    calendarGrid() {\n      const grid = &#91;];\n      let week = &#91;];\n      let dayCounter = 1;\n      for (let i = 0; i &lt; this.firstDayOfMonth; i++) {\n        week.push(null);\n      }\n      while (dayCounter &lt;= this.daysInMonth) {\n        week.push(new Date(this.year, this.month - 1, dayCounter));\n        if (week.length === 7) {\n          grid.push(week);\n          week = &#91;];\n        }\n        dayCounter++;\n      }\n      while (week.length &lt; 7 &amp;&amp; week.length &gt; 0) {\n        week.push(null);\n      }\n      if (week.length &gt; 0) {\n        grid.push(week);\n      }\n      return grid;\n    },\n  },\n  methods: {\n    isToday(date) {\n      return (\n        date &amp;&amp;\n        date.getDate() === this.todayDate &amp;&amp;\n        date.getMonth() + 1 === this.todayMonth &amp;&amp;\n        date.getFullYear() === this.todayYear\n      );\n    },\n    getWorkLogsForDate(date) {\n      if (!date) {\n        return &#91;];\n      }\n      const formattedDate = `${date.getFullYear()}-${(date.getMonth() + 1)\n        .toString()\n        .padStart(2, \"0\")}-${date.getDate().toString().padStart(2, \"0\")}`;\n      return this.calendarWorkLogs.filter((log) =&gt; log.date === formattedDate);\n    },\n  },\n};\n&lt;\/script&gt;\n<\/code><\/pre>\n\n\n\n<p><strong>\u8ffd\u52a0\u5f8c\u306e\u5909\u66f4\u70b9\u3068\u8aac\u660e:<\/strong><\/p>\n\n\n\n<p><strong>1. <code>App.vue<\/code> \u306e <code>&lt;script&gt;<\/code> \u306e\u5909\u66f4:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5909\u66f4\u524d:<\/strong> <code>handleWorkFinished<\/code> \u3067\u30ab\u30ec\u30f3\u30c0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306b <code>calendarRef.value.addWorkLog(logData)<\/code> \u3092\u76f4\u63a5\u547c\u3073\u51fa\u3057\u3001\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306f <code>calendarWorkLogs.value.push(logData)<\/code> \u3067\u4fdd\u6301\u3057\u3066\u3044\u307e\u3057\u305f\u3002\u307e\u305f\u3001<code>mounted<\/code> \u30d5\u30c3\u30af\u3067\u753b\u9762\u9077\u79fb\u6642\u306b\u4fdd\u6301\u3057\u3066\u3044\u308b\u30ed\u30b0\u3092\u30ab\u30ec\u30f3\u30c0\u30fc\u306b\u53cd\u6620\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u5909\u66f4\u5f8c:<\/strong> <code>handleWorkFinished<\/code> \u3067\u306f\u3001<strong>\u5e38\u306b<\/strong> \u53d7\u3051\u53d6\u3063\u305f <code>logData<\/code> \u3092 <code>calendarWorkLogs.value.push(logData)<\/code> \u3067\u4fdd\u6301\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u30ab\u30ec\u30f3\u30c0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306b\u95a2\u308f\u3089\u305a\u3001\u4f5c\u696d\u30ed\u30b0\u306f <code>calendarWorkLogs<\/code> \u306b\u84c4\u7a4d\u3055\u308c\u307e\u3059\u3002<code>mounted<\/code> \u30d5\u30c3\u30af\u3068\u305d\u306e\u95a2\u9023\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u5909\u66f4\u306e\u7406\u7531:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ab\u30ec\u30f3\u30c0\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u89aa\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089\u76f4\u63a5\u547c\u3073\u51fa\u3059\u306e\u306f\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u9593\u306e\u4f9d\u5b58\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u3001\u3088\u308a\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306e\u4ed5\u7d44\u307f\u306b\u6cbf\u3063\u305f\u5f62\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u753b\u9762\u9077\u79fb\u6642\u306b\u30ed\u30b0\u3092\u53cd\u6620\u3059\u308b\u51e6\u7406\u306f\u3001<code>props<\/code> \u3068 <code>watch<\/code> \u3092\u4f7f\u3046\u3053\u3068\u3067\u3088\u308a\u30ea\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>2. <code>PomodoroCalendar.vue<\/code> \u306e <code>&lt;script&gt;<\/code> \u306e\u5909\u66f4:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5909\u66f4\u524d:<\/strong> <code>props<\/code> \u3067 <code>workLogs<\/code> \u3092\u53d7\u3051\u53d6\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u5024\u304c\u5909\u66f4\u3055\u308c\u3066\u3082\u81ea\u52d5\u7684\u306b\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u8868\u793a\u306f\u66f4\u65b0\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u5909\u66f4\u5f8c:<\/strong> <code>watch<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u3001<code>workLogs<\/code> props \u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u304d\u306b\u3001\u5185\u90e8\u306e <code>calendarWorkLogs<\/code> \u3092 <code>[...newWorkLogs]<\/code> \u3067\u66f4\u65b0\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u8ffd\u52a0\u306e\u7406\u7531:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>props<\/code> \u306f\u89aa\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304b\u3089\u5b50\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3078\u30c7\u30fc\u30bf\u3092\u6e21\u3059\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002<code>App.vue<\/code> \u306e <code>calendarWorkLogs<\/code> \u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u3001<code>PomodoroCalendar<\/code> \u306e <code>workLogs<\/code> props \u3082\u81ea\u52d5\u7684\u306b\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>watch<\/code> \u3092\u4f7f\u3046\u3053\u3068\u3067\u3001<code>workLogs<\/code> props \u306e\u5909\u66f4\u3092\u76e3\u8996\u3057\u3001\u5909\u66f4\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u8868\u793a\u306b\u5fc5\u8981\u306a <code>calendarWorkLogs<\/code> \u3092\u66f4\u65b0\u3059\u308b\u3053\u3068\u3067\u3001\u753b\u9762\u304c\u30ea\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5909\u66f4\u3092\u52a0\u3048\u308b\u3053\u3068\u3067\u3001\u30bf\u30a4\u30de\u30fc\u304c\u7d42\u4e86\u3059\u308b\u3068 <code>App.vue<\/code> \u306e <code>calendarWorkLogs<\/code> \u304c\u66f4\u65b0\u3055\u308c\u3001\u305d\u306e\u5909\u66f4\u304c <code>PomodoroCalendar<\/code> \u306e <code>workLogs<\/code> props \u3092\u901a\u3058\u3066\u76e3\u8996\u3055\u308c\u3001\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u8868\u793a\u304c\u66f4\u65b0\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u5834\uff11\u753b\u9762\u306b\u96c6\u7d04\u3055\u308c\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u305f\u3081\u6a5f\u80fd\u3054\u3068\u306b\u30da\u30fc\u30b8\u3092\u5206\u3051\u3066\u3044\u304d\u307e\u3059 \u30b9\u30c6\u30c3\u30d7\uff12\uff1a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a src \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b router \u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u4e2d\u306b index.js \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":1,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":184,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/184"}],"wp:attachment":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}