{"id":191,"date":"2025-05-03T17:15:11","date_gmt":"2025-05-03T08:15:11","guid":{"rendered":"https:\/\/suyasuyahirohiro.com\/?p=191"},"modified":"2025-05-03T17:15:11","modified_gmt":"2025-05-03T08:15:11","slug":"%e7%b4%90%e4%bb%98%e3%81%91%ef%bc%92","status":"publish","type":"post","link":"https:\/\/suyasuyahirohiro.com\/?p=191","title":{"rendered":"\u7d10\u4ed8\u3051\uff12"},"content":{"rendered":"\n<p><strong>\u8003\u3048\u3089\u308c\u308b\u539f\u56e0:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u65e5\u4ed8\u306e\u4e0d\u4e00\u81f4:<\/strong> <code>PomodoroTimer<\/code> \u304b\u3089 <code>$emit<\/code> \u3055\u308c\u308b <code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u306e <code>date<\/code> \u306e\u5f62\u5f0f\u3068\u3001<code>PomodoroCalendar<\/code> \u3067\u30ed\u30b0\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3059\u308b\u969b\u306e\u65e5\u4ed8\u5f62\u5f0f\u304c\u4e00\u81f4\u3057\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u6642\u523b\u306e\u7bc4\u56f2:<\/strong> <code>getWorkLogsForDateAndTime<\/code> \u30e1\u30bd\u30c3\u30c9\u3067\u3001\u30bf\u30b9\u30af\u304c\u8a72\u5f53\u306e\u6642\u9593\u5e2f\u306b\u8868\u793a\u3055\u308c\u308b\u6761\u4ef6\u304c\u53b3\u3057\u3059\u304e\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>calendarRef<\/code> \u306e\u30bf\u30a4\u30df\u30f3\u30b0:<\/strong> <code>App.vue<\/code> \u3067 <code>calendarRef<\/code> \u304c <code>null<\/code> \u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067 <code>handleWorkFinished<\/code> \u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff11\uff1a<code>PomodoroTimer.vue<\/code> \u306e\u4fee\u6b63\uff08<code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u306e <code>date<\/code> \u306e\u5f62\u5f0f\u3092\u660e\u78ba\u5316\uff09<\/strong><\/p>\n\n\n\n<p><code>PomodoroCalendar<\/code> \u3067\u306e\u65e5\u4ed8\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3068\u78ba\u5b9f\u306b\u4e00\u81f4\u3059\u308b\u3088\u3046\u306b\u3001<code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u3067\u9001\u4fe1\u3059\u308b <code>date<\/code> \u306e\u5f62\u5f0f\u3092 <code>YYYY-MM-DD<\/code> \u306b\u7d71\u4e00\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u5909\u66f4\u524d (<code>PomodoroTimer.vue<\/code> \u306e\u8a72\u5f53\u7b87\u6240):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        this.$emit(\"work-finished\", {\n          date: new Date().toISOString().slice(0, 10),\n          startTime: this.workStartTime,\n          endTime: workEndTime,\n          task: \"\u96c6\u4e2d\u4f5c\u696d\", \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5909\u66f4\u53ef\u80fd\n        });\n<\/code><\/pre>\n\n\n\n<p><strong>\u5909\u66f4\u5f8c (<code>PomodoroTimer.vue<\/code> \u306e\u8a72\u5f53\u7b87\u6240):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        const today = new Date();\n        const year = today.getFullYear();\n        const month = (today.getMonth() + 1).toString().padStart(2, '0');\n        const day = today.getDate().toString().padStart(2, '0');\n        const formattedDate = `${year}-${month}-${day}`;\n        this.$emit(\"work-finished\", {\n          date: formattedDate,\n          startTime: this.workStartTime,\n          endTime: workEndTime,\n          task: \"\u96c6\u4e2d\u4f5c\u696d\", \/\/ \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5909\u66f4\u53ef\u80fd\n        });\n<\/code><\/pre>\n\n\n\n<p><strong>\u5909\u66f4\u70b9\u306e\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>new Date().toISOString().slice(0, 10)<\/code> \u3067\u53d6\u5f97\u3057\u3066\u3044\u305f\u65e5\u4ed8\u5f62\u5f0f\u3092\u3001\u5e74\u30fb\u6708\u30fb\u65e5\u3092\u305d\u308c\u305e\u308c\u53d6\u5f97\u3057\u3066 <code>padStart(2, '0')<\/code> \u30672\u6841\u306b\u63c3\u3048\u3001<code>-<\/code> \u3067\u7d50\u5408\u3059\u308b\u5f62\u5f0f\u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001<code>YYYY-MM-DD<\/code> \u5f62\u5f0f\u306e\u65e5\u4ed8\u304c\u78ba\u5b9f\u306b\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff12\uff1a<code>PomodoroCalendar.vue<\/code> \u306e\u4fee\u6b63\uff08<code>getWorkLogsForDateAndTime<\/code> \u306e\u6761\u4ef6\u3092\u7de9\u548c\uff09<\/strong><\/p>\n\n\n\n<p>\u30bf\u30b9\u30af\u306e\u958b\u59cb\u6642\u9593\u3068\u7d42\u4e86\u6642\u9593\u304c\u5b8c\u5168\u306b\u4e00\u81f4\u3059\u308b\u6642\u9593\u5e2f\u306e\u307f\u3092\u8868\u793a\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u958b\u59cb\u6642\u9593\u3092\u542b\u3080\u6642\u9593\u5e2f\u306b\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u6761\u4ef6\u3092\u7de9\u548c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u5909\u66f4\u524d (<code>PomodoroCalendar.vue<\/code> \u306e <code>getWorkLogsForDateAndTime<\/code> \u30e1\u30bd\u30c3\u30c9):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    getWorkLogsForDateAndTime(date, hour) {\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; {\n        if (log.date === formattedDate) {\n          const startTimeParts = log.startTime.split(\":\");\n          const endTimeParts = log.endTime.split(\":\");\n          const startHour = parseInt(startTimeParts&#91;0]);\n          const endHour = parseInt(endTimeParts&#91;0]);\n\n          return startHour &lt;= hour &amp;&amp; hour &lt; endHour; \/\/ \u958b\u59cb\u6642\u9593\u4ee5\u964d\u3001\u7d42\u4e86\u6642\u9593\u307e\u3067\u306e\u30bf\u30b9\u30af\u3092\u8868\u793a\n        }\n        return false;\n      });\n    },\n<\/code><\/pre>\n\n\n\n<p><strong>\u5909\u66f4\u5f8c (<code>PomodoroCalendar.vue<\/code> \u306e <code>getWorkLogsForDateAndTime<\/code> \u30e1\u30bd\u30c3\u30c9):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    getWorkLogsForDateAndTime(date, hour) {\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; {\n        if (log.date === formattedDate) {\n          const startTimeParts = log.startTime.split(\":\");\n          const startHour = parseInt(startTimeParts&#91;0]);\n\n          return startHour === hour; \/\/ \u958b\u59cb\u6642\u9593\u306e\u6642\u9593\u5e2f\u306b\u30bf\u30b9\u30af\u3092\u8868\u793a\n        }\n        return false;\n      });\n    },\n<\/code><\/pre>\n\n\n\n<p><strong>\u5909\u66f4\u70b9\u306e\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30bf\u30b9\u30af\u3092\u8868\u793a\u3059\u308b\u6761\u4ef6\u3092 <code>startHour &lt;= hour &amp;&amp; hour &lt; endHour<\/code> \u304b\u3089 <code>startHour === hour<\/code> \u306b\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30bf\u30b9\u30af\u306e\u958b\u59cb\u6642\u9593\u306e\u6642\u9593\u5e2f\u306b\u305d\u306e\u30bf\u30b9\u30af\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001\u3088\u308a\u67d4\u8edf\u306a\u8868\u793a\u6761\u4ef6\uff08\u4f8b\u3048\u3070\u3001\u958b\u59cb\u6642\u9593\u307e\u305f\u306f\u7d42\u4e86\u6642\u9593\u3092\u542b\u3080\u6642\u9593\u5e2f\u306a\u3069\uff09\u306b\u8abf\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff13\uff1a<code>App.vue<\/code> \u306e\u4fee\u6b63\uff08<code>calendarRef<\/code> \u306e\u5b58\u5728\u78ba\u8a8d\u3092\u3088\u308a\u78ba\u5b9f\u306b\u3059\u308b\uff09<\/strong><\/p>\n\n\n\n<p><code>handleWorkFinished<\/code> \u3067 <code>calendarRef<\/code> \u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089 <code>addWorkLog<\/code> \u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u5909\u66f4\u524d (<code>App.vue<\/code> \u306e <code>handleWorkFinished<\/code> \u95a2\u6570):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    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      if (route.path === \"\/calendar\" &amp;&amp; calendarRef.value) {\n        calendarRef.value.addWorkLog(logData); \/\/ \u30ab\u30ec\u30f3\u30c0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u76f4\u63a5\u8ffd\u52a0\n      }\n    };\n<\/code><\/pre>\n\n\n\n<p><strong>\u5909\u66f4\u5f8c (<code>App.vue<\/code> \u306e <code>handleWorkFinished<\/code> \u95a2\u6570):<\/strong><\/p>\n\n\n\n<p>JavaScript<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    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      if (route.path === \"\/calendar\" &amp;&amp; calendarRef.value) {\n        \/\/ setTimeout \u3092\u4f7f\u7528\u3057\u3066\u3001\u308f\u305a\u304b\u306a\u9045\u5ef6\u5f8c\u306b addWorkLog \u3092\u547c\u3073\u51fa\u3059\n        setTimeout(() =&gt; {\n          calendarRef.value.addWorkLog(logData);\n        }, 0);\n      }\n    };\n<\/code><\/pre>\n\n\n\n<p><strong>\u5909\u66f4\u70b9\u306e\u89e3\u8aac:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>setTimeout(() => { ... }, 0)<\/code> \u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u73fe\u5728\u306e JavaScript \u306e\u30a4\u30d9\u30f3\u30c8\u30eb\u30fc\u30d7\u306e\u6700\u5f8c\u306b <code>calendarRef.value.addWorkLog(logData)<\/code> \u306e\u547c\u3073\u51fa\u3057\u304c\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001<code>PomodoroCalendar<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u78ba\u5b9f\u306b\u30de\u30a6\u30f3\u30c8\u3055\u308c\u3001<code>calendarRef<\/code> \u304c\u5229\u7528\u53ef\u80fd\u306b\u306a\u3063\u305f\u5f8c\u306b <code>addWorkLog<\/code> \u304c\u5b9f\u884c\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u307e\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u305f\u304c\u53cd\u6620\u3055\u308c\u306a\u3044<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u691c\u8a3c<\/h2>\n\n\n\n<p>\u627f\u77e5\u3044\u305f\u3057\u307e\u3057\u305f\u3002\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u4f7f\u3063\u3066\u3001\u30bf\u30a4\u30de\u30fc\u7d42\u4e86\u5f8c\u306e\u30bf\u30b9\u30af\u304c\u30ab\u30ec\u30f3\u30c0\u30fc\u306b\u53cd\u6620\u3055\u308c\u306a\u3044\u539f\u56e0\u3092\u7279\u5b9a\u3059\u308b\u305f\u3081\u306e\u5177\u4f53\u7684\u306a\u691c\u8a3c\u624b\u9806\u3092\u30b9\u30c6\u30c3\u30d7\u3054\u3068\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff11\uff1aConsole \u30bf\u30d6\u306e\u78ba\u8a8d\uff08JavaScript \u30a8\u30e9\u30fc\u306e\u6709\u7121\uff09<\/strong><\/p>\n\n\n\n<p>\u307e\u305a\u3001JavaScript \u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u306a\u3044\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u958b\u304f:<\/strong> \u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u304d\u3001F12 \u30ad\u30fc\uff08\u307e\u305f\u306f\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u300c\u691c\u8a3c\u300d\u3092\u9078\u629e\uff09\u3092\u62bc\u3057\u3066\u958b\u767a\u8005\u30c4\u30fc\u30eb\u3092\u958b\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>Console \u30bf\u30d6\u3092\u9078\u629e:<\/strong> \u958b\u767a\u8005\u30c4\u30fc\u30eb\u306e\u30bf\u30d6\u306e\u4e2d\u304b\u3089\u300cConsole\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30a8\u30e9\u30fc\u306e\u78ba\u8a8d:<\/strong> \u8d64\u3044\u6587\u5b57\u3067\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3042\u308c\u3070\u3001\u305d\u306e\u5185\u5bb9\u3092\u8a73\u3057\u304f\u8aad\u307f\u3001\u3069\u306e\u30d5\u30a1\u30a4\u30eb\u3084\u884c\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30a8\u30e9\u30fc\u306e\u5185\u5bb9\u306b\u3088\u3063\u3066\u306f\u3001\u554f\u984c\u306e\u539f\u56e0\u304c\u76f4\u63a5\u7684\u306b\u793a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff12\uff1aVue Devtools \u306e\u78ba\u8a8d\uff08\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u72b6\u614b\u3068\u30c7\u30fc\u30bf\u306e\u6d41\u308c\uff09<\/strong><\/p>\n\n\n\n<p>Vue.js \u306e\u72b6\u614b\u7ba1\u7406\u3084\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001Vue Devtools \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u307e\u3060\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001Chrome \u30a6\u30a7\u30d6\u30b9\u30c8\u30a2\u307e\u305f\u306f Firefox Add-ons \u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Vue Devtools \u3092\u958b\u304f:<\/strong> \u958b\u767a\u8005\u30c4\u30fc\u30eb\u304c\u958b\u3044\u3066\u3044\u308b\u72b6\u614b\u3067\u3001Vue Devtools \u306e\u30bf\u30d6\u3092\u9078\u629e\u3057\u307e\u3059\uff08Vue \u306e\u30a2\u30a4\u30b3\u30f3\u304c\u4ed8\u3044\u3066\u3044\u307e\u3059\uff09\u3002<\/li>\n\n\n\n<li><strong>Components \u30bf\u30d6\u3092\u9078\u629e:<\/strong> Vue Devtools \u306e\u30bf\u30d6\u306e\u4e2d\u304b\u3089\u300cComponents\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u9078\u629e:<\/strong> \u5de6\u5074\u306e\u30c4\u30ea\u30fc\u304b\u3089 <code>&lt;PomodoroTimer><\/code> \u3068 <code>&lt;PomodoroCalendar><\/code> \u3092\u63a2\u3057\u3066\u9078\u629e\u3057\u3001\u305d\u308c\u305e\u308c\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e <code>props<\/code>\u3001<code>data<\/code>\u3001<code>computed<\/code> \u306e\u5024\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30bf\u30a4\u30de\u30fc\u64cd\u4f5c\u6642\u306e\u30c7\u30fc\u30bf\u306e\u5909\u5316:<\/strong> \u30bf\u30a4\u30de\u30fc\u3092\u958b\u59cb\u3057\u3001\u7d42\u4e86\u3055\u305b\u305f\u969b\u306b\u3001<code>&lt;PomodoroTimer><\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u95a2\u9023\u30c7\u30fc\u30bf\uff08\u4f8b\u3048\u3070\u3001<code>workStartTime<\/code>\u3001\u30bf\u30a4\u30de\u30fc\u306e\u72b6\u614b\u30d5\u30e9\u30b0\u306a\u3069\uff09\u304c\u3069\u306e\u3088\u3046\u306b\u5909\u5316\u3059\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u306e\u78ba\u8a8d:<\/strong> \u30bf\u30a4\u30de\u30fc\u304c\u7d42\u4e86\u3057\u305f\u969b\u306b\u3001Vue Devtools \u306e\u30a4\u30d9\u30f3\u30c8\u30ed\u30b0\uff08Components \u30bf\u30d6\u306e\u4e0b\u90e8\u306b\u3042\u308b\u30a4\u30d9\u30f3\u30c8\u30bb\u30af\u30b7\u30e7\u30f3\uff09\u306b <code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u304c\u767a\u884c\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u307e\u305f\u3001\u305d\u306e\u30da\u30a4\u30ed\u30fc\u30c9\uff08\u9001\u4fe1\u3055\u308c\u305f\u30c7\u30fc\u30bf\uff09\u306e\u5185\u5bb9 (<code>date<\/code>, <code>startTime<\/code>, <code>endTime<\/code> \u306a\u3069\uff09\u304c\u6b63\u3057\u3044\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>Not declared\u3068\u306a\u3063\u3066\u3044\u305f\u305f\u3081\u4ee5\u4e0b\u3092\u8ffd\u52a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"419\" src=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-05-01-23.52.53-1024x419.png\" alt=\"\" class=\"wp-image-192\" srcset=\"https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-05-01-23.52.53-1024x419.png 1024w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-05-01-23.52.53-300x123.png 300w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-05-01-23.52.53-768x314.png 768w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-05-01-23.52.53-1536x629.png 1536w, https:\/\/suyasuyahirohiro.com\/wp-content\/uploads\/2025\/05\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-05-01-23.52.53-2048x839.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><code>&lt;PomodoroTimer&gt;<\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067 <code>$emit(\"work-finished\", {...})<\/code> \u306f\u3057\u3066\u3044\u308b\u3082\u306e\u306e\u3001\u305d\u306e\u30ab\u30b9\u30bf\u30e0\u30a4\u30d9\u30f3\u30c8\u304c <code>&lt;PomodoroTimer&gt;<\/code> \u3092\u4f7f\u3063\u3066\u3044\u308b\u5074\uff08\uff1d<code>App.vue<\/code>\uff09\u3067 <strong><code>emits<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u306a\u3044<\/strong> \u305f\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 \u89e3\u6c7a\u65b9\u6cd5<\/h3>\n\n\n\n<p><code>PomodoroTimer.vue<\/code> \u306e <code>&lt;script&gt;<\/code> \u90e8\u5206\u306b\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">js\u30b3\u30d4\u30fc\u3059\u308b\u7de8\u96c6\u3059\u308b<code>export default {\n  emits: [\"work-finished\"], \/\/ \u2190 \u3053\u308c\u3092\u8ffd\u52a0\uff01\n  data() {\n    return {\n      \/\/ \u65e2\u5b58\u306edata\u5185\u5bb9\n    };\n  },\n  ...\n};<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>&lt;App><\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u78ba\u8a8d:<\/strong> <code>&lt;App><\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u9078\u629e\u3057\u3001<code>calendarWorkLogs<\/code> <code>ref<\/code> \u306e\u5024\u304c\u3069\u306e\u3088\u3046\u306b\u5909\u5316\u3059\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<code>handleWorkFinished<\/code> \u304c\u6b63\u3057\u304f\u5b9f\u884c\u3055\u308c\u3001\u30ed\u30b0\u30c7\u30fc\u30bf\u304c <code>calendarWorkLogs<\/code> \u306b\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>&lt;PomodoroCalendar><\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u78ba\u8a8d:<\/strong> <code>&lt;PomodoroCalendar><\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u9078\u629e\u3057\u3001<code>workLogs<\/code> <code>props<\/code> \u306e\u5024\u304c\u89aa\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 (<code>&lt;App><\/code>) \u304b\u3089\u6b63\u3057\u304f\u6e21\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u307e\u305f\u3001<code>calendarWorkLogs<\/code> <code>data<\/code> \u306e\u5024\u304c\u3069\u306e\u3088\u3046\u306b\u5909\u5316\u3059\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<code>mounted<\/code> \u30d5\u30c3\u30af\u3067 <code>workLogs<\/code> \u306e\u5185\u5bb9\u304c <code>calendarWorkLogs<\/code> \u306b\u53cd\u6620\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u30bf\u30a4\u30de\u30fc\u7d42\u4e86\u5f8c\u306b <code>addWorkLog<\/code> \u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u969b\u306b <code>calendarWorkLogs<\/code> \u306b\u65b0\u3057\u3044\u30ed\u30b0\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff13\uff1aNetwork \u30bf\u30d6\u306e\u78ba\u8a8d\uff08API \u901a\u4fe1\u306e\u6709\u7121\uff09<\/strong><\/p>\n\n\n\n<p>\u3082\u3057\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3068\u901a\u4fe1\u3057\u3066\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u30fb\u53d6\u5f97\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001Network \u30bf\u30d6\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u4eca\u56de\u306e\u30b1\u30fc\u30b9\u3067\u306f\u53ef\u80fd\u6027\u306f\u4f4e\u3044\u3067\u3059\u304c\u3001\u5ff5\u306e\u305f\u3081\u78ba\u8a8d\u3057\u3066\u304a\u304f\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Network \u30bf\u30d6\u3092\u9078\u629e:<\/strong> \u958b\u767a\u8005\u30c4\u30fc\u30eb\u306e\u30bf\u30d6\u306e\u4e2d\u304b\u3089\u300cNetwork\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u78ba\u8a8d:<\/strong> \u30bf\u30a4\u30de\u30fc\u64cd\u4f5c\u6642\u3084\u30ab\u30ec\u30f3\u30c0\u30fc\u8868\u793a\u6642\u306b\u3001\u65b0\u3057\u3044\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u9001\u4fe1\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002\u3082\u3057\u30ea\u30af\u30a8\u30b9\u30c8\u304c\u3042\u308c\u3070\u3001\u305d\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3001\u30d8\u30c3\u30c0\u30fc\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff14\uff1a\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u306e\u8ffd\u8de1<\/strong><\/p>\n\n\n\n<p>Vue Devtools \u3092\u4f7f\u3063\u3066\u3001<code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u304b\u3089\u30ab\u30ec\u30f3\u30c0\u30fc\u3078\u306e\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u8ffd\u8de1\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30bf\u30a4\u30de\u30fc\u7d42\u4e86:<\/strong> \u30bf\u30a4\u30de\u30fc\u3092\u7d42\u4e86\u3055\u305b\u3001<code>work-finished<\/code> \u30a4\u30d9\u30f3\u30c8\u304c\u767a\u884c\u3055\u308c\u308b\u3053\u3068\u3092 Vue Devtools \u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>App.vue<\/code> \u3067\u306e\u53d7\u4fe1:<\/strong> <code>App.vue<\/code> \u306e <code>handleWorkFinished<\/code> \u95a2\u6570\u304c\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001<code>calendarWorkLogs<\/code> \u3092\u66f4\u65b0\u3057\u3066\u3044\u308b\u304b\u3001\u307e\u305f\u3001\u6761\u4ef6\u306b\u5fdc\u3058\u3066 <code>calendarRef.value.addWorkLog<\/code> \u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>PomodoroCalendar.vue<\/code> \u3067\u306e\u53d7\u4fe1:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Props \u306e\u78ba\u8a8d:<\/strong> <code>&lt;PomodoroCalendar><\/code> \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e <code>workLogs<\/code> <code>props<\/code> \u304c\u66f4\u65b0\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>watch<\/code> \u306e\u78ba\u8a8d:<\/strong> <code>workLogs<\/code> <code>props<\/code> \u306e <code>watch<\/code> \u95a2\u6570\u304c\u30c8\u30ea\u30ac\u30fc\u3055\u308c\u3001<code>calendarWorkLogs<\/code> \u304c\u66f4\u65b0\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>addWorkLog<\/code> \u306e\u78ba\u8a8d:<\/strong> <code>addWorkLog<\/code> \u95a2\u6570\u304c\u547c\u3073\u51fa\u3055\u308c\u305f\u5834\u5408\u3001<code>calendarWorkLogs<\/code> \u306b\u65b0\u3057\u3044\u30ed\u30b0\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong><code>getWorkLogsForDateAndTime<\/code> \u306e\u78ba\u8a8d:<\/strong> \u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u8868\u793a\u304c\u66f4\u65b0\u3055\u308c\u305f\u969b\u306b\u3001<code>getWorkLogsForDateAndTime<\/code> \u95a2\u6570\u304c <code>calendarWorkLogs<\/code> \u3092\u6b63\u3057\u304f\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3057\u3001\u8868\u793a\u3059\u3079\u304d\u30bf\u30b9\u30af\u3092\u8fd4\u3057\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u305d\u306e\u969b\u3001\u6bd4\u8f03\u3057\u3066\u3044\u308b <code>date<\/code> \u306e\u5f62\u5f0f\u3084\u6642\u9593\u306e\u7bc4\u56f2\u304c\u9069\u5207\u304b\u3069\u3046\u304b\u3082\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u8003\u3048\u3089\u308c\u308b\u539f\u56e0: \u30b9\u30c6\u30c3\u30d7\uff11\uff1aPomodoroTimer.vue \u306e\u4fee\u6b63\uff08work-finished \u30a4\u30d9\u30f3\u30c8\u306e date \u306e\u5f62\u5f0f\u3092\u660e\u78ba\u5316\uff09 PomodoroCalendar \u3067\u306e\u65e5\u4ed8\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3068 &#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-191","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/191","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=191"}],"version-history":[{"count":1,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=\/wp\/v2\/posts\/191\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suyasuyahirohiro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}