{"id":6052,"date":"2020-08-26T10:51:52","date_gmt":"2020-08-26T01:51:52","guid":{"rendered":"https:\/\/nsme.red\/wp\/?p=6052"},"modified":"2020-10-19T15:27:10","modified_gmt":"2020-10-19T06:27:10","slug":"v-calendar-%e3%82%ab%e3%83%ac%e3%83%b3%e3%83%80%e3%83%bc","status":"publish","type":"post","link":"https:\/\/core.nsme.net\/notes\/vue-js\/%e3%83%a9%e3%82%a4%e3%83%96%e3%83%a9%e3%83%aa\/6052\/","title":{"rendered":"V-Calendar \u30ab\u30ec\u30f3\u30c0\u30fc"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">CDN\n\u516c\u5f0f\u30b5\u30a4\u30c8\u306b,\u66f8\u3044\u3066\u3042\u308b\u3068\u304a\u308a\u3060\u3068\u3001\u52dd\u624b\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5f8c\u52d5\u304b\u306a\u304f\u306a\u3063\u305f\u3002\n\u3084\u306f\u308a\u3001CDN\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u7121\u3057\u3067\u3064\u304b\u3046\u306e\u306f\u6016\u3044\uff01\uff01\n\u3000\u52d5\u4f5c\u78ba\u8a8d\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u2193<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script src='https:\/\/unpkg.com\/v-calendar@1.0.8\/lib\/v-calendar.umd.min.js'>&lt;\/script>\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"has-inline-color has-vivid-purple-color\">\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u6a2a\u306b\u4e26\u3079\u305f\u3044\u6642<\/span>\n<strong>:columns=\"2\"<\/strong><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"has-inline-color has-vivid-purple-color\">\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u975e\u8868\u793a\u306b\u3059\u308b<\/span>\n<strong>nav-visibility=\"hidden\"<\/strong><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><span class=\"has-inline-color has-vivid-purple-color\">\u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u6a2a\u306b\u4e26\u3079\u305f\u3044\u6642<\/span>\n\u53c2\u8003 \u300cV-Calendar\u300d\u306e\u65e5\u4ed8\u306e\u5165\u529b\u5236\u9650\u3059\u308b\u65b9\u6cd5<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>available-dates=\"{months:&#91;9,10] }\" <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br>\u30ab\u30ec\u30f3\u30c0\u30fc\u6a5f\u80fd\u306e\u6642\u306f<code>&lt;v-calendar&gt;<\/code><br><strong>datepicker<\/strong>\u306e\u6642\u306f<code>&lt;v-date-picker&gt;<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u30ab\u30ec\u30f3\u30c0\u30fc\u30d8\u30c3\u30c0\u30fc\u3092\u5909\u66f4<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;v-date-picker \n\tmode=\"multiple\" \n\tis-required\n\tis-inline\n\tnav-visibility=\"hidden\"\n\t:available-dates=\"{months:&#91;&lt;?php \n\t\techo $call_month;\n\t\t\t?>] }\" \n\tv-model=\"repeat_day\"\n\t\t>\n\t&lt;template slot='header-title' slot-scope='page'>\n      {{page.yearLabel}}\u5e74{{page.monthLabel}}\n    &lt;\/template>\n\t\t&lt;\/v-date-picker><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/vcalendar.io\/\">https:\/\/vcalendar.io\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.kabanoki.net\/3890\/\">\u300cV-Calendar\u300d\u306e\u4f7f\u3044\u65b9<\/a><\/p>\n\n\n\n<p class=\"has-background wp-block-paragraph\" style=\"background-color:#d5e3dd\">\u30a4\u30d9\u30f3\u30c8\u30ab\u30ec\u30f3\u30c0\u30fc\u3068\u3057\u3066\u5229\u7528\u3000\u901a\u5e38\u306e\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30ab\u30ec\u30f3\u30c0\u30fc\u306e\u8868\u793a\u5e74\u6708\u3092Watch\u3057\u3066\u3001\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3081\u3070\u3044\u3044\u306e\u3060\u304c\u3001\u3046\u307e\u304f\u53d6\u5f97\u3067\u304d\u305a\u3001\u65ad\u5ff5\u3002(T_T)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;v-calendar ref=\"calendar\" is-expanded>\n    &lt;template slot='header-title' slot-scope='props'>\n      {{props.yearLabel}}\u5e74{{props.monthLabel}}&lt;!--\u3000{{props.key}}-->\n\t\t\t\n    &lt;\/template>\n    &lt;template slot='day-content' slot-scope='props'>\n      &lt;div class=\"cell-header\">\n        {{props.day.day}}\n      &lt;\/div>\n      &lt;div class=\"cell-content\">\n      &lt;template \n      v-if=\"dateList.some(date => date.ymd === dateToYYYYMMDD(props.day.date))\">\n        &lt;div \n        class=\"cell-content-line\" \n        v-for=\"content in getContentFromKey(dateToYYYYMMDD(props.day.date))\" \n        v-bind:key=\"content\">\n          {{content}}\n        &lt;\/div>\n        &lt;\/template>\n      &lt;\/div>\n    &lt;\/template>\n\n    &lt;\/v-calendar>\n\n\n&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.5.16\/dist\/vue.js\">&lt;\/script>\n&lt;script src='https:\/\/unpkg.com\/v-calendar'>&lt;\/script>\n&lt;script>\n\nvar app = new Vue({\n\t el: '#content',\n\t data() {\n    return {\n      dateList: &#91;\n        {ymd: '20200923', contents: &#91;'\u9aea\u3092\u5207\u308b','\u9762\u8ac7','\u9774\u3092\u8cb7\u3046']},\n        {ymd: '20200914', contents: &#91;'\u7d50\u5a5a\u5f0f']},\n        {ymd: '20200901', contents: &#91;'\u59b9\u306e\u8a95\u751f\u65e5']},\n        {ymd: '20200817', contents: &#91;'\u6d77\u306b\u884c\u304f\uff01', '\u91ce\u7403\u306e\u7df4\u7fd2']}\n      ]\n    }\n\t },\n\tmounted() {\n\t\tconst calendar = this.$refs.calendar;\n\t\tconsole.log(calendar.data.pages&#91;0].key);\n},\n\tmethods: {\n     dateToYYYYMMDD: function(date) {\n      let y = date.getFullYear();\n      let m = ('00' + (date.getMonth()+1)).slice(-2);\n      let d = ('00' + date.getDate()).slice(-2);\n      let result = y + '' + m + '' + d;\n      return result;\n    },\n    getContentFromKey: function(key) {\n      const target = this.dateList.find((date) => {\n        return (date.ymd === key);\n      })\n      return target.contents;\n    }\n  }\n\t\n })\t\n\t&lt;\/script><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>CDN \u516c\u5f0f\u30b5\u30a4\u30c8\u306b,\u66f8\u3044\u3066\u3042\u308b\u3068\u304a\u308a\u3060\u3068\u3001\u52dd\u624b\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5f8c\u52d5\u304b\u306a\u304f\u306a\u3063\u305f\u3002 \u3084\u306f\u308a\u3001CDN\u3092\u30d0\u30fc\u30b8\u30e7\u30f3\u6307\u5b9a\u7121\u3057\u3067\u3064\u304b\u3046\u306e\u306f\u6016\u3044\uff01\uff01 \u3000\u52d5\u4f5c\u78ba\u8a8d\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u2193 \u30ab\u30ec\u30f3\u30c0\u30fc\u3092\u6a2a\u306b\u4e26\u3079\u305f\u3044\u6642 :columns=&#8221;2&#8243; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[39],"tags":[],"class_list":["post-6052","post","type-post","status-publish","format-standard","hentry","category-39"],"acf":[],"_links":{"self":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/comments?post=6052"}],"version-history":[{"count":6,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6052\/revisions"}],"predecessor-version":[{"id":6082,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/posts\/6052\/revisions\/6082"}],"wp:attachment":[{"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/media?parent=6052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/categories?post=6052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/core.nsme.net\/notes\/wp-json\/wp\/v2\/tags?post=6052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}