{"id":2144,"date":"2025-03-24T09:30:20","date_gmt":"2025-03-24T00:30:20","guid":{"rendered":"https:\/\/comcent.co.jp\/blog\/?p=2144"},"modified":"2025-03-19T13:29:26","modified_gmt":"2025-03-19T04:29:26","slug":"vue-js-3%e7%b3%bb%e3%81%ae%e8%a1%a8%e8%a8%98%e3%82%86%e3%82%8c%e5%a4%a7%e5%85%a8%e9%9b%86","status":"publish","type":"post","link":"https:\/\/comcent.co.jp\/blog\/archives\/2144\/","title":{"rendered":"Vue.js 3\u7cfb\u306e\u8868\u8a18\u3086\u308c\u5927\u5168\u96c6"},"content":{"rendered":"\n<p>\u50d5\u306f\u307e\u3060 Vue.js \u3092\u4f7f\u7528\u3057\u59cb\u3081\u3066\u307e\u3060\u65e5\u304c\u6d45\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082 2 \u7cfb\u2192 3 \u7cfb\u306e\u904e\u6e21\u671f\u3092\u4f53\u9a13\u3057\u3066\u304d\u307e\u3057\u305f\u3002<br>\u305d\u3057\u3066\u3075\u3068\u3001\u6614\u306b\u66f8\u3044\u305f Vue.js \u306e\u30b3\u30fc\u30c9\u3092\u898b\u308b\u3068\u73fe\u5728\u306e\u30b3\u30fc\u30c9\u3068\u5927\u5206\u898b\u305f\u76ee\u304c\u9055\u3046\u3053\u3068\u306b\u6c17\u304c\u4ed8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eba\u6c17\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3060\u3051\u3042\u3063\u3066\u3001\u4e16\u306b\u306f Vue.js \u306e\u89e3\u8aac\u8a18\u4e8b\u304c\u6ea2\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u540c\u3058\u3053\u3068\u3092\u8aac\u660e\u3057\u3066\u3044\u3066\u3082\u4f7f\u7528\u3057\u3066\u3044\u308b\u8a18\u6cd5\u304c\u5168\u7136\u9055\u3063\u3066\u6df7\u4e71\u3057\u305f\u306e\u3082\u61d0\u304b\u3057\u3044\u601d\u3044\u51fa\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u305d\u3093\u306a\u3001\u89e3\u8aac\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u3082\u65b9\u8a00\u304c\u30ad\u30c4\u304f\u3066\u8a71\u304c\u901a\u3058\u306a\u3044\u3068\u304a\u60a9\u307f\u306e\u7686\u3055\u3093\u306b\u3001\u8868\u8a18\u3086\u308c\u30b1\u30fc\u30b9\u3054\u3068\u306b\u89e3\u8aac\u3092\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">html \u4e0a\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u21d4 &lt;div id=\"app\"&gt;&lt;\/div&gt;<\/h4>\n\n\n\n<p>Vue.js \u3092\u5b66\u7fd2\u3057\u3088\u3046\u3068\u3059\u308b\u969b\u3001\u4e00\u756a\u624b\u8efd\u306a\u306e\u306f CDN \u3092\u4f7f\u3063\u3066\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script src=\"https:\/\/unpkg.com\/vue@3\/dist\/vue.global.js\"&gt;&lt;\/script&gt;<\/pre>\n\n\n\n<p>\u306e\u3088\u3046\u306a\u5f62\u3067 Vue.js \u3092\u8aad\u307f\u8fbc\u3093\u3060\u5f8c\u3001\u30ed\u30b8\u30c3\u30af\u90e8\u5206\u306f\u5f8c\u306b\u7d9a\u304f &lt;script&gt;&lt;\/script&gt; \u306e\u4e2d\u306b\u66f8\u304d\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u90e8\u5206\u306f HTML \u306e\u4e0a\u306b\u76f4\u63a5\u66f8\u304f\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u3088\u3046\u306a\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u6d41\u3057\u898b\u3001\u307e\u305f\u306f\u5199\u7d4c\u3057\u3066\u307f\u305f\u5f8c\u306b\u3001\u3044\u3056\u4ed5\u4e8b\u306e\u30b3\u30fc\u30c9 or \u4ed6\u306e\u89e3\u8aac\u8a18\u4e8b\u3092\u898b\u3066\u307f\u308b\u3068\u3001\u305d\u3046\u306a\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u3002<br>\u4ee3\u308f\u308a\u306b\u3001HTML \u90e8\u5206\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30bf\u30b0\u304c\u307d\u3064\u3093\u3068\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u3068\u601d\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;div id=\"app\"&gt;&lt;\/div&gt;<\/pre>\n\n\n\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u69cb\u6587\u306f\u3069\u3053\u306b\u884c\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u304b\u3001\u3068\u8a00\u3046\u3068 <strong>.js<\/strong>, \u307e\u305f\u306f <strong>.vue<\/strong> (<a rel=\"noreferrer noopener\" href=\"https:\/\/ja.vuejs.org\/guide\/introduction.html#single-file-components\" target=\"_blank\">SFC\u3001\u5358\u4e00\u30d5\u30a1\u30a4\u30eb\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/a>)\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u306b\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u3002<br>\u30d6\u30e9\u30a6\u30b6\u3067\u76f4\u63a5\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u306e\u306f\u9593\u9055\u3044\u306a\u304f <strong>.js<\/strong> \u30d5\u30a1\u30a4\u30eb\u3067\u3059\u304c\u3001\u305d\u308c\u304c\u305d\u306e\u307e\u307e\u4eba\u9593\u306e\u66f8\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u304b <strong>webpack <\/strong>\u3084 <strong>Vite<\/strong> \u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u304b\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3088\u308a\u307e\u3059\u3002<br>\u5143\u306e\u30b3\u30fc\u30c9\u3092\u63a2\u3057\u305f\u3044\u306e\u3067\u3042\u308c\u3070\u3001\u3068\u308a\u3042\u3048\u305a\u300c<strong>src<\/strong>\u300d\u3084\u300c<strong>resources<\/strong>\u300d\u306a\u3069\u306e\u540d\u79f0\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u7121\u3044\u304b\u3001\u305d\u308c\u304c\u3042\u308c\u3070\u4e2d\u8eab\u3092\u63a2\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u306a\u304a\u3001\u3042\u306a\u305f\u304c\u305d\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u30d6\u30e9\u30a6\u30b6\u8d8a\u3057\u306b\u5229\u7528\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3001\u5143\u306e\u30b3\u30fc\u30c9\u304c\u624b\u5143\u306b\u5b58\u5728\u3057\u306a\u3044\u3001\u307e\u305f\u306f\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u5143\u30b3\u30fc\u30c9\u3092\u53c2\u7167\u3067\u304d\u306a\u3044\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002<br><strong>webpack <\/strong>\u3084 <strong>Vite<\/strong> \u3092\u7528\u3044\u3066\u958b\u767a\u3059\u308b\u5834\u5408\u3001\u4eba\u9593\u304c\u8aad\u307f\u66f8\u304d\u3059\u308b JavaScript \u3068\u30d6\u30e9\u30a6\u30b6\u306b\u8aad\u307f\u8fbc\u307e\u305b\u308b JavaScript \u306f\u5225\u3068\u306a\u308a\u3001\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u5f8c\u8005\u306e\u307f\u3001\u3068\u3044\u3046\u30b1\u30fc\u30b9\u304c\u591a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u5bfe\u3057\u3066\u3001\u5143\u3005\u306e html \u4e0a\u306b Vue \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u69cb\u6587\u3092\u524d\u3082\u3063\u3066\u66f8\u3044\u3066\u304a\u3051\u308b\u3053\u3068\u304c\u521d\u8033\u306e\u65b9\u3082\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br>\u50d5\u306f Vue.js \u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3059\u3063\u98db\u3070\u3057\u3066 <strong>webpack <\/strong>+ <strong>SFC <\/strong>\u304b\u3089\u59cb\u3081\u305f\u958b\u767a\u8005\u306a\u306e\u3067\u3001 <strong>index.html<\/strong> \u306e\u4e0a\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u66f8\u3044\u3066\u3042\u308b\u4f8b\u3092\u898b\u3066\u9a5a\u3044\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">v-bind, v-on, v-slot \u21d4 :, @, #<\/h4>\n\n\n\n<p><a href=\"https:\/\/ja.vuejs.org\/api\/built-in-directives.html#v-bind\" target=\"_blank\" rel=\"noreferrer noopener\">v-bind<\/a> \u3084 <a href=\"https:\/\/ja.vuejs.org\/api\/built-in-directives.html#v-on\" target=\"_blank\" rel=\"noreferrer noopener\">v-on<\/a> \u306f Vue.js \u3092\u4f5c\u308b\u4e0a\u3067\u306f\u5fc5\u9808\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u3059\u304c\u3001\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u306b\u306f\u4e00\u3064\u3082\u898b\u5f53\u305f\u3089\u306a\u3044\u2026\u2026\u3068\u601d\u3063\u305f\u3089\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;input\n  v-bind:name=\"nameVar\"\n  v-on:click=\"clickHandler\"\n  type=\"submit\"\n  value=\"\u9001\u4fe1\u3059\u308b\"\n&gt;<\/pre>\n\n\n\n<p>\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3067\u306f\u306a\u304f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;input\n  :name=\"nameVar\"\n  @click=\"clickHandler\"\n  type=\"submit\"\n  value=\"\u9001\u4fe1\u3059\u308b\"\n&gt;<\/pre>\n\n\n\n<p>\u3092\u63a2\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306f\u3044\u308f\u3086\u308b\u77ed\u7e2e\u8a18\u6cd5\u3067\u3001\u305d\u308c\u305e\u308c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;div v-bind:name=\"hoge\"&gt;&lt;\/div&gt;\n&lt;div :name=\"hoge\"&gt;&lt;\/div&gt;\n\n&lt;div v-on:click=\"hoge\"&gt;&lt;\/div&gt;\n&lt;div @click=\"hoge\"&gt;&lt;\/div&gt;<\/pre>\n\n\n\n<p>\u304c\u540c\u3058\u610f\u5473\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306b\u3064\u3044\u3066\u306f\u65e2\u306b\u77e5\u3063\u3066\u3044\u308b\u4eba\u3082\u591a\u3044\u304b\u3068\u601d\u308f\u308c\u307e\u3059\u304c\u3001<a href=\"https:\/\/ja.vuejs.org\/guide\/components\/slots.html#fallback-content\" target=\"_blank\" rel=\"noreferrer noopener\">\u6700\u8fd1\u540d\u524d\u4ed8\u304d\u30b9\u30ed\u30c3\u30c8<\/a>\u3092\u5b9f\u88c5\u3059\u308b v-slot \u3082 Vue.js 2.6 \u304b\u3089\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u306b\u95a2\u3057\u3066\u306f\u6b21\u306e\u7ae0\u3067\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">slot=\"hoge\" \u21d4 v-slot:hoge \u21d4 #hoge<\/h4>\n\n\n\n<p>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u3088\u308a\u4fbf\u5229\u306b\u3059\u308b\u30b9\u30ed\u30c3\u30c8\u6a5f\u80fd\u3067\u3059\u304c\u3001\u4e00\u3064\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u8907\u6570\u306e\u30b9\u30ed\u30c3\u30c8\u3092\u6271\u3046\u5834\u5408\u306f<a href=\"https:\/\/ja.vuejs.org\/guide\/components\/slots.html#fallback-content\" target=\"_blank\" rel=\"noreferrer noopener\">\u540d\u524d\u4ed8\u304d\u30b9\u30ed\u30c3\u30c8<\/a>\u3092\u6271\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b50\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5074\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;template&gt;\n  &lt;article&gt;\n    &lt;h1&gt;\n      &lt;slot name=\"title\"&gt;&lt;\/slot&gt;\n    &lt;\/h1&gt;\n    &lt;div class=\"content\"&gt;\n      &lt;slot&gt;&lt;\/slot&gt;\n    &lt;\/div&gt;\n  &lt;\/div&gt;\n  &lt;aide&gt;\n    &lt;slot name=\"digression\"&gt;&lt;\/slot&gt;\n  &lt;\/aside&gt;\n&lt;\/template&gt;<\/pre>\n\n\n\n<p>\u306e\u3088\u3046\u306b name \u5c5e\u6027\u3092\u7528\u3044\u3066\u63cf\u753b\u3057\u305f\u3044\u30b9\u30ed\u30c3\u30c8\u3092\u5206\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u89aa\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5074\u3067\u306f Vue.js 2.5 \u307e\u3067\u306f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;HogeContainer&gt;\n  &lt;template slot=\"title\"&gt;\n    &lt;span class=\"titleSub\"&gt;\u3010\u306a\u306b\u3082\u5206\u304b\u3089\u306a\u3044\u3011&lt;\/span&gt;\n    &lt;span class=\"titleMain\"&gt;Vue.js \u5b8c\u5168\u306b\u7406\u89e3\u3057\u305f&lt;\/span&gt;\n  &lt;\/template&gt;\n  &lt;p&gt;\u3054\u3081\u3093\u306a\u3055\u3044\u5168\u7136\u5206\u304b\u308a\u307e\u305b\u3093\u3002&lt;\/p&gt;\n  &lt;p&gt;\u4e09\u65e5\u8abf\u3079\u3066\u3082 Hello World \u304c\u52d5\u304d\u307e\u305b\u3093\u3002&lt;\/p&gt;\n  &lt;template slot=\"digression\"&gt;\n    &lt;p&gt;\u203bReact \u306f\u4e00\u9031\u9593\u304b\u3051\u3066\u3082\u99c4\u76ee\u3067\u3057\u305f\u3002&lt;\/p&gt;\n  &lt;\/template&gt;\n&lt;\/HogeContainer&gt;<\/pre>\n\n\n\n<p>\u3068\u3044\u3063\u305f\u8a18\u6cd5\u3060\u3063\u305f\u306e\u306b\u5bfe\u3057\u3001 Vue.js 2.6 \u304b\u3089\u306f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;HogeContainer&gt;\n  &lt;template v-slot:title&gt;\n    &lt;span class=\"titleSub\"&gt;\u3010\u306a\u306b\u3082\u5206\u304b\u3089\u306a\u3044\u3011&lt;\/span&gt;\n    &lt;span class=\"titleMain\"&gt;Vue.js \u5b8c\u5168\u306b\u7406\u89e3\u3057\u305f&lt;\/span&gt;\n  &lt;\/template&gt;\n  &lt;p&gt;\u3054\u3081\u3093\u306a\u3055\u3044\u5168\u7136\u5206\u304b\u308a\u307e\u305b\u3093\u3002&lt;\/p&gt;\n  &lt;p&gt;\u4e09\u65e5\u8abf\u3079\u3066\u3082 Hello World \u304c\u52d5\u304d\u307e\u305b\u3093\u3002&lt;\/p&gt;\n  &lt;template v-slot:digression&gt;\n    &lt;p&gt;\u203bReact \u306f\u4e00\u9031\u9593\u304b\u3051\u3066\u3082\u99c4\u76ee\u3067\u3057\u305f\u3002&lt;\/p&gt;\n  &lt;\/template&gt;\n&lt;\/HogeContainer&gt;<\/pre>\n\n\n\n<p>\u3068\u3044\u3046\u8a18\u6cd5\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u66f4\u306b\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;HogeContainer&gt;\n  &lt;template #title&gt;\n    &lt;span class=\"titleSub\"&gt;\u3010\u306a\u306b\u3082\u5206\u304b\u3089\u306a\u3044\u3011&lt;\/span&gt;\n    &lt;span class=\"titleMain\"&gt;Vue.js \u5b8c\u5168\u306b\u7406\u89e3\u3057\u305f&lt;\/span&gt;\n  &lt;\/template&gt;\n  &lt;p&gt;\u3054\u3081\u3093\u306a\u3055\u3044\u5168\u7136\u5206\u304b\u308a\u307e\u305b\u3093\u3002&lt;\/p&gt;\n  &lt;p&gt;\u4e09\u65e5\u8abf\u3079\u3066\u3082 Hello World \u304c\u52d5\u304d\u307e\u305b\u3093\u3002&lt;\/p&gt;\n  &lt;template #digression&gt;\n    &lt;p&gt;\u203bReact \u306f\u4e00\u9031\u9593\u304b\u3051\u3066\u3082\u99c4\u76ee\u3067\u3057\u305f\u3002&lt;\/p&gt;\n  &lt;\/template&gt;\n&lt;\/HogeContainer&gt;<\/pre>\n\n\n\n<p>\u306e\u3088\u3046\u306b # \u3092\u4ed8\u3051\u308b\u3068 <strong>v-slot: <\/strong>\u306e\u77ed\u7e2e\u8a18\u6cd5\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5148\u8ff0\u306e <strong>:<\/strong>, <strong>@<\/strong> \u3088\u308a\u898b\u304b\u3051\u308b\u983b\u5ea6\u306f\u4f4e\u3044\u3068\u601d\u308f\u308c\u308b\u306e\u3067\u3001\u3082\u3057\u304b\u3057\u305f\u3089\u6238\u60d1\u3046\u8a18\u6cd5\u304b\u3082\u3057\u308c\u306a\u3044\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">new Vue() \u21d4 createApp() \u21d4 Vue.createApp()<\/h4>\n\n\n\n<p>2 \u7cfb\u3067\u3042\u308d\u3046\u3068 3 \u7cfb\u3067\u3042\u308d\u3046\u3068\u3001 Vue.js \u304c\u8d77\u52d5\u3059\u308b\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u305e\u308c\u30012 \u7cfb\u3067\u306f <a href=\"https:\/\/jp.vuejs.org\/v2\/guide\/instance.html\" target=\"_blank\" rel=\"noreferrer noopener\">Vue \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9<\/a>\u3001 3 \u7cfb\u3067\u306f<a href=\"https:\/\/ja.vuejs.org\/guide\/essentials\/application.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9<\/a>\u3068\u8868\u73fe\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u30ed\u30b8\u30c3\u30af\u3092\u5b9a\u7fa9\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30fb\u307e\u305f\u306f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u81ea\u4f53\u3092\u521d\u671f\u5024\u3068\u3057\u3066\u5b9f DOM \u306b\u30de\u30a6\u30f3\u30c8\u3059\u308b\u6d41\u308c\u306f\u5909\u308f\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3057\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u4f5c\u308a\u65b9\u306f 2 \u7cfb\u304c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">new Vue({\n  el: '#app',\n  data() {\n    return { hoge: 'fuga' };\n  }\n});<\/pre>\n\n\n\n<p>\u306e\u3088\u3046\u306a\u3082\u306e\u3060\u3063\u305f\u306e\u306b\u5bfe\u3057\u3001 3 \u7cfb\u3067\u306f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">createApp({\n  data() {\n    return { hoge: 'fuga' };\n }\n}).mount('#app');<\/pre>\n\n\n\n<p>\u3068\u3001Vue \u305d\u306e\u3082\u306e\u3067\u306f\u306a\u304f\u3001<a href=\"https:\/\/ja.vuejs.org\/api\/application.html#createapp\">createApp<\/a> \u3068\u3044\u3046\u30b0\u30ed\u30fc\u30d0\u30eb API \u3092\u4f7f\u7528\u3059\u308b\u5f62\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>.mount() \u306e\u90e8\u5206\u306f 2 \u7cfb\u3067\u3082 .$mount() \u304c\u4f7f\u7528\u3067\u304d\u3066\u3044\u307e\u3057\u305f\u304c\u3001 3 \u7cfb\u3067\u306f\u7b2c\u4e00\u5f15\u6570\u306b\u6307\u5b9a\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089 el \u304c\u7121\u304f\u306a\u308a\u3001.mount() \u306b\u4e00\u672c\u5316\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>3 \u7cfb\u304b\u3089\u306f\u516c\u5f0f\u306e<a href=\"https:\/\/ja.vuejs.org\/guide\/quick-start.html#using-vue-from-cdn\">\u30b0\u30ed\u30fc\u30d0\u30eb\u30d3\u30eb\u30c9\u306e\u4f7f\u7528<\/a>\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u4e0b\u624b\u3059\u308b\u3068 Vue \u306f createApp \u306a\u3069\u306e API \u304c\u542b\u307e\u308c\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u3057\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u4f59\u8a08\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br>\u3064\u307e\u308a\u3001 Vue \u3092 CDN \u306a\u3069\u304b\u3089\u76f4\u63a5\u8aad\u307f\u8fbc\u3080\u5834\u5408\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">Vue.createApp({\n  data() {\n    return { hoge: 'fuga' };\n  }\n}).mount('#app');<\/pre>\n\n\n\n<p>\u306e\u3088\u3046\u306a\u8a18\u6cd5\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5bfe\u3057\u3066<a href=\"https:\/\/ja.vuejs.org\/guide\/quick-start.html#using-vue-from-cdn\">ES \u30e2\u30b8\u30e5\u30fc\u30eb \u30d3\u30eb\u30c9\u306e\u4f7f\u7528<\/a>\u3067\u3082\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u307b\u3068\u3093\u3069\u306e\u30e2\u30c0\u30f3\u30d6\u30e9\u30a6\u30b6\u304c ES \u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u73fe\u5728\u306b\u304a\u3044\u3066\u306f\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import {createApp} from \"Vue.js \u306e URL\u3001\u307e\u305f\u306f\u30d1\u30b9\";<\/pre>\n\n\n\n<p>\u3068\u3044\u3046\u8868\u8a18\u3082\u5f53\u305f\u308a\u524d\u306b\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u306a\u306e\u3067\u3053\u308c\u304b\u3089 3 \u7cfb\u306b\u89e6\u308c\u308b\u958b\u767a\u8005\u306f\u3001createApp \u306a\u3069\u306e API \u304c Vue.js \u3092\u8aad\u307f\u8fbc\u3081\u3070\u4f7f\u7528\u3067\u304d\u308b\u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u30e2\u30ce\u3067\u306f\u306a\u304f\u3001\u3042\u304f\u307e\u3067 Vue \u304b\u3089\u9078\u629e\u7684\u306b import \u3057\u3066\u4f7f\u7528\u3059\u308b\u30e2\u30ce\u3060\u3068\u3001\u982d\u306e\u7247\u9685\u306b\u7f6e\u3044\u3066\u304a\u304f\u3068\u6df7\u4e71\u3057\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">\uff08new Vue(App) \u21d4 new Vue({ render: h =&gt; h(App) })<\/h4>\n\n\n\n<p>\u7ae0\u30bf\u30a4\u30c8\u30eb\u3067\u306f 2 \u7cfb\u3067\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u3001 3 \u7cfb\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a18\u8ff0\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">import {createApp} from \"vue\";\nimport App from \"App.vue \u306e\u30d1\u30b9\";\ncreateApp(App).mount('#app');<\/pre>\n\n\n\n<p>\u3068<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">import {createApp} from \"vue\";\nimport App from \"App.vue \u306e\u30d1\u30b9\";\ncreateApp({ render: h =&gt; h(App) }).mount('#app');<\/pre>\n\n\n\n<p>\u3053\u306e\u66f8\u304d\u304b\u305f\u3092\u898b\u304b\u3051\u308b\u7406\u7531\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e 2 \u30d1\u30bf\u30fc\u30f3\u306b\u5927\u5225\u3055\u308c\u308b\u3068\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbJavaScript \u306e\u529b\u3092\u4f7f\u3063\u3066\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u306f\u89e3\u6c7a\u3057\u8f9b\u3044\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3092\u884c\u3044\u305f\u304b\u3063\u305f<br>\u30fb\u6d41\u884c\u3063\u3066\u3044\u305f\u306e\u3067\u63a1\u7528\u3055\u308c\u305f<\/p>\n\n\n\n<p>\u524d\u8005\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001App \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u5185\u306b Vue \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u69cb\u6587\u304c\u5b58\u5728\u305b\u305a\u3001\u4ee3\u308f\u308a\u306b JavaScript \u3067 HTML \u6587\u5b57\u5217\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u90e8\u5206\u304c\u898b\u3064\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br>\u809d\u306b\u306a\u308b render \u90e8\u5206\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u63cf\u753b\u95a2\u6570(3 \u7cfb\u3067\u306f<a rel=\"noreferrer noopener\" href=\"https:\/\/ja.vuejs.org\/guide\/extras\/render-function.html\" target=\"_blank\">\u30ec\u30f3\u30c0\u30fc\u95a2\u6570<\/a>)\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3001\u666e\u6bb5\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u69cb\u6587\u3092\u4f7f\u7528\u3057\u3066\u66f8\u304f HTML \u90e8\u5206\u3092 JavaScript \u306b\u3088\u3063\u3066\u66f8\u304f\u6a5f\u80fd\u3067\u3059\u3002<br><a rel=\"noreferrer noopener\" href=\"https:\/\/jp.vuejs.org\/v2\/guide\/render-function.html\" target=\"_blank\">2 \u7cfb\u306e\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3067\u306f\u3001render \u3092\u4f7f\u7528\u3059\u308b\u3068\u3069\u306e\u3088\u3046\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308b\u306e\u304b\u5206\u304b\u308a\u3084\u3059\u304f\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5bfe\u3057\u3066\u5f8c\u8005\u306f\u3001\u78ba\u8a3c\u306f\u6301\u3066\u307e\u305b\u3093\u304c\u6050\u3089\u304f <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/vuejs-templates\/webpack-simple\" target=\"_blank\">webpack-simple<\/a> \u3068\u3044\u3046 Vue.js 2.x + webpack 3.x \u3067\u69cb\u7bc9\u3055\u308c\u305f\u74b0\u5883\u306e\u96db\u5f62\u30d5\u30a1\u30a4\u30eb\u304c\u521d\u51fa\u306e\u66f8\u304d\u65b9\u3067\u3059\u3002<br>\u3053\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306e Issue \u300c<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/vuejs-templates\/webpack-simple\/issues\/29\" target=\"_blank\">Explanation for render: h =&gt; h(App) please #29<\/a>\u300d\u3067\u3082\u5c0b\u306d\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u516c\u5f0f\u304c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">import Vue from 'vue'\nimport App from '.\/App.vue'\nnew Vue({\n  el: '#app',\n  render: h =&gt; h(App)\n})<\/pre>\n\n\n\n<p>\u3068\u3044\u3063\u305f\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u304a\u308a\u3001\u591a\u304f\u306e\u4eba\u304c\u300crender \u3068\u306f\u306a\u3093\u3060\uff1f\u300d\u3068\u306f\u601d\u3044\u3064\u3064\u3001\u3053\u308c\u3092\u4f7f\u7528\u3057\u59cb\u3081\u305f\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u308f\u308c\u307e\u3059\u3002<br>\u306a\u305c\u306a\u3089\u3001render \u3092\u4f7f\u308f\u305a\u3001\u7d20\u76f4\u306b Vue \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u4ee5\u4e0b\u306b\u306a\u308b\u305f\u3081\u3001render \u3092\u4f7f\u7528\u3057\u305f\u307b\u3046\u304c\u30b3\u30fc\u30c9\u304c\u77ed\u304f\u306a\u308b\u304b\u3089\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">import Vue from 'vue'\nimport App from '.\/App.vue'\nnew Vue({\n  el: '#app',\n  components: {App},\n  template: '&lt;App \/&gt;'\n})<\/pre>\n\n\n\n<p>\u305f\u3060\u3057\u3001Vue.js \u306e 2 \u7cfb\u3067\u30c6\u30b9\u30c8\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001el \u3067\u306f\u306a\u304f $mounted() \u3092\u4f7f\u7528\u3059\u308c\u3070\u3001\u308f\u3056\u308f\u3056 render \u3092\u4f7f\u7528\u305b\u305a\u3068\u3082\u4ee5\u4e0b\u3067\u52d5\u4f5c\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">import Vue from 'vue'\nimport App from '.\/App.vue'\nnew Vue(App).$mounted('#app')<\/pre>\n\n\n\n<p>render \u3092\u4f7f\u7528\u3059\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u65b9\u6cd5\u306f\u3001\u53b3\u5bc6\u306b\u306f\u52b9\u7387\u3084\u30e1\u30ea\u30c3\u30c8\u3068\u8a00\u3046\u3088\u308a\u306f\u3001\u5358\u306b\u3088\u304f\u77e5\u3089\u308c\u305f\u5b9a\u578b\u6587\u3068\u3057\u3066\u5e83\u307e\u3063\u305f\u8a18\u6cd5\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">Vue.component('HogeContainer', {}) \u21d4 import HogeContainer from \"\u2026\"<\/h4>\n\n\n\n<p>\u3069\u3061\u3089\u3082\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\u306e\u65b9\u6cd5\u3067\u3059\u304c\u3001\u4e8c\u3064\u306e\u70b9\u3067\u4f7f\u7528\u76ee\u7684\u304c\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fb.vue (<a href=\"https:\/\/ja.vuejs.org\/guide\/introduction.html#single-file-components\" target=\"_blank\" rel=\"noreferrer noopener\">SFC\u3001\u5358\u4e00\u30d5\u30a1\u30a4\u30eb\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/a>)\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u3044\u3066\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u308b\u304b\u3001 JavaScript \u306b\u76f4\u66f8\u304d\u3059\u308b\u304b\u3002<br>\u30fb\u30b0\u30ed\u30fc\u30d0\u30eb\u767b\u9332\u3059\u308b\u304b\u3001\u30ed\u30fc\u30ab\u30eb\u767b\u9332\u3059\u308b\u304b<\/p>\n\n\n\n<p>\u3084\u3084\u53e4\u3044\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u304a\u3044\u3066\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u307e\u305a\u300cJavaScript \u306b\u76f4\u66f8\u304d\u300d \u00d7 \u300c\u30b0\u30ed\u30fc\u30d0\u30eb\u767b\u9332\u300d\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<br>\u3084\u3084\u3053\u3057\u3044\u6e96\u5099\u3084\u6982\u5ff5\u306e\u5b66\u7fd2\u7121\u3057\u306b\u59cb\u3081\u3089\u308c\u308b\u306e\u3067\u3001\u6700\u521d\u306b Vue.js \u3092\u5b66\u7fd2\u3059\u308b\u3068\u304d\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u304c\u591a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;div id=\"app\"&gt;&lt;test-component \/&gt;&lt;\/div&gt;\n\nimport { createApp } from 'vue';\nconst app = createApp({}).mount('#app');\napp.component('TestComponent', {\n  data() {\n    return {\n      count: 0\n    }\n  },\n  template: `<code>\n    &lt;button @click=\"count++\"&gt;\n      You clicked me {{ count }} times.\n    &lt;\/button&gt;<\/code>`\n });<\/pre>\n\n\n\n<p>\u305f\u3060\u3057\u3001\u958b\u767a\u306b\u6163\u308c\u3066 SFC \u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u66f8\u304d\u65b9\u3067\u958b\u767a\u3092\u9032\u3081\u308b\u30b1\u30fc\u30b9\u304c\u591a\u304f\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;div id=\"app\"&gt;&lt;\/div&gt;\nimport { createApp } from 'vue';\nimport TestComponent from '\/path\/to\/TestComponent.vue';\nconst app = createApp(TestComponent).mount('#app');<\/pre>\n\n\n\n<p>\u307e\u305a\u3001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">import TestComponent from '\/path\/to\/TestComponent.vue';<\/pre>\n\n\n\n<p>\u306e\u6709\u7121\u306f\u5206\u304b\u308a\u3084\u3059\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3088\u304f\u898b\u308b\u3068 app.component() \u3082\u7701\u304b\u308c\u3066\u3044\u308b\u306e\u304c\u5206\u304b\u308a\u307e\u3059\u3002<br>app.component() \u3092\u4f7f\u7528\u3057\u306a\u3044\u5834\u5408\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u30ed\u30fc\u30ab\u30eb\u306b\u767b\u9332\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e0a\u8a18\u3067\u306f createApp() \u306b\u3044\u304d\u306a\u308a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30b5\u30d6\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u30ed\u30fc\u30ab\u30eb\u767b\u9332\u3059\u308b\u5834\u5408\u306f components \u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>TestComponent.vue<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script&gt;\nimport SubTestComponent from '\/path\/to\/SubTestComponent.vue'\nexport default {\n  components: {\n    SubTestComponent\n  },\n  data() {\n    return {\n      \/\/\u2026\n    }\n  }\n}\n&lt;\/script&gt;\n&lt;template&gt;\n  &lt;SubTestComponent \/&gt;\n&lt;\/template&gt;<\/pre>\n\n\n\n<p>\u3057\u304b\u3057\u3001CompositionAPI + &lt;script setup&gt; \u3092\u4f7f\u7528\u3059\u308b\u3068 components \u3059\u3089\u4e0d\u8981\u306b\u306a\u308a\u3001\u3088\u308a\u30cd\u30a4\u30c6\u30a3\u30d6 JavaScript \u306b\u8fd1\u3044\u898b\u305f\u76ee\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script setup&gt;\nimport SubTestComponent from '\/path\/to\/SubTestComponent.vue'\n&lt;\/script&gt;\n&lt;template&gt;\n  &lt;SubTestComponent \/&gt;\n&lt;\/template&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">&lt;hoge-container&gt; \u21d4 &lt;HogeContainer&gt;<\/h4>\n\n\n\n<p>Vue \u3092\u6271\u3063\u3066\u3044\u308b\u3068\u4e3b\u306b\u30d1\u30b9\u30ab\u30eb\u30b1\u30fc\u30b9(\u5358\u8a9e\u3054\u3068\u306b\u5148\u982d\u3092\u5927\u6587\u5b57\u306b\u3059\u308b)\u3068\u30b1\u30d0\u30d6\u30b1\u30fc\u30b9(\u5358\u8a9e\u3054\u3068\u306b-\u3067\u533a\u5207\u308b)\u306e\u4e8c\u3064\u3092\u6271\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u547d\u540d\u3059\u308b\u3068\u304d\u306f<a rel=\"noreferrer noopener\" href=\"https:\/\/v3.ja.vuejs.org\/style-guide\/#%E8%A4%87%E6%95%B0%E5%8D%98%E8%AA%9E%E3%81%AE%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E5%90%8D-%E5%BF%85%E9%A0%88\" target=\"_blank\">\u307b\u307c\u5927\u62b5<a rel=\"noreferrer noopener\" href=\"https:\/\/v3.ja.vuejs.org\/style-guide\/#%E8%A4%87%E6%95%B0%E5%8D%98%E8%AA%9E%E3%81%AE%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E5%90%8D-%E5%BF%85%E9%A0%88\" target=\"_blank\">\u3001<\/a>\u8907\u6570\u5358\u8a9e\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u540d<\/a>\u3092\u4f7f\u7528\u3057\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u69cb\u6587\u4e0a\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u30d1\u30b9\u30ab\u30eb\u30b1\u30fc\u30b9\u3092\u4f7f\u3046\u30b1\u30fc\u30b9\u3068\u30b1\u30d0\u30d6\u30b1\u30fc\u30b9\u3092\u4f7f\u3046\u30b1\u30fc\u30b9\u304c\u6df7\u5728\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/v3.ja.vuejs.org\/style-guide\/#%E3%83%86%E3%83%B3%E3%83%95%E3%82%9A%E3%83%AC%E3%83%BC%E3%83%88%E5%86%85%E3%81%A6%E3%82%99%E3%81%AE%E3%82%B3%E3%83%B3%E3%83%9B%E3%82%9A%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E5%90%8D%E3%81%AE%E5%BD%A2%E5%BC%8F-%E5%BC%B7%E3%81%8F%E6%8E%A8%E5%A5%A8\" target=\"_blank\" rel=\"noreferrer noopener\">\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5185\u3067\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u540d\u306e\u5f62\u5f0f<\/a><\/p>\n\n\n\n<p>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u3088\u308c\u3070\u3001JavaScript \u306e\u4e2d\u3067\u306f\u30d1\u30b9\u30ab\u30eb\u30b1\u30fc\u30b9\u3001 HTML \u3067\u306f\u30b1\u30d0\u30d6\u30b1\u30fc\u30b9\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001Vue \u3067\u3082\u305d\u308c\u3092\u63a8\u5968\u3057\u3066\u3044\u308b\u3068\u306e\u3053\u3068\u3002<\/p>\n\n\n\n<p>\u3076\u3063\u3061\u3083\u3051\u3069\u3061\u3089\u3082\u52d5\u304f\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u4ed5\u4e8b\u306e\u5834\u5408\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u65b9\u91dd\u306b\u5408\u308f\u305b\u3066\u958b\u767a\u3092\u9032\u3081\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">{data() {}, methods: {}, mounted() {}, \u2026} \u21d4 { setup(props, emits) {} }<\/h4>\n\n\n\n<p>2 \u7cfb\u306e\u9803\u304b\u3089\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u5f93\u6765\u306e OptionsAPI \u306b\u5bfe\u3057\u3066 CompositionAPI \u3068\u3044\u3046\u8a18\u6cd5\u304c\u767b\u5834\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>2 \u7cfb\u3067\u958b\u767a\u3092\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u4eba\u304c\u3001\u300c\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u90e8\u5206\u306f\u5206\u304b\u308b\u304c\u3001script \u90e8\u5206\u306f\u672c\u5f53\u306b Vue \u306a\u306e\u304b\u2026\u2026\uff1f\u300d\u3068\u3044\u3046\u611f\u60f3\u3092\u62b1\u3044\u305f\u3089\u307b\u307c\u9593\u9055\u3044\u306a\u304f CompositionAPI \u304c\u63a1\u7528\u3055\u308c\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/ja.vuejs.org\/guide\/extras\/composition-api-faq.html\" target=\"_blank\" rel=\"noreferrer noopener\">CompositionAPI \u306e\u7d39\u4ecb\u306f\u516c\u5f0f\u3092\u53c2\u7167\u3057\u3066\u8cb0\u3046\u3068\u3057\u3066<\/a>\u3001\u8ffd\u52a0\u3067\u7d39\u4ecb\u3057\u305f\u3044\u3053\u3068\u3068\u3057\u3066\u3001\u540c\u3058 CompositionAPI \u3067\u3082\u66f4\u306b &lt;script setup&gt; \u3068\u3044\u3046\u8a18\u6cd5\u3092\u4f7f\u7528\u3059\u308b\u304b\u5426\u304b\u3067\u30b3\u30fc\u30c9\u304c\u5909\u308f\u3063\u3066\u304f\u308b\u70b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5f93\u6765\u306e CompositionAPI \u3067\u306f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script&gt;\nimport { ref } from 'vue';\nexport default {\n  setup() {\n    const count = ref(0);\n    <code>return {<\/code>\n      <code>count <\/code>\n    <code>};<\/code>\n  }\n}:\n&lt;\/script&gt;<\/pre>\n\n\n\n<pre id=\"block-0e627406-fb01-4edb-b36b-6b560eacf690\" class=\"wp-block-preformatted\"> \u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3044\u305f\u90e8\u5206\u304c\u3001<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script setup&gt;\nimport { ref } from 'vue';\nconst count = ref(0)\n&lt;\/script&gt;<\/pre>\n\n\n\n<p>\u3068\u3001\u307e\u308b\u3067 &lt;script&gt;&lt;\/script&gt; \u81ea\u4f53\u304c setup: function() {} \u306e\u30b9\u30b3\u30fc\u30d7\u306e\u3088\u3046\u306b\u632f\u821e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">defineProps({}), defineEmits([])\u3001 \u21d4 defineProps&lt;{}&gt;(), defineEmits&lt;{}&gt;()<\/h4>\n\n\n\n<p>&lt;script setup&gt; \u3067\u306f export default {} \u304c\u53d6\u3063\u6255\u308f\u308c\u308b\u306e\u3067\u3001props \u3084 emits \u3082\u4e00\u7dd2\u306b\u3069\u3053\u304b\u3078\u884c\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3059\u308b\u306e\u304c defineProps() \u3068 defineEmits() \u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script setup&gt;\nconst props = defineProps({\n  title: {\n    require: true,\n    type: String\n  },\n  important: {\n    require: false,\n    type: Boolean\n  }\n});\nconst emits = defineEmits(['hoverTitle']);\n&lt;\/script&gt;\n&lt;template&gt;\n  &lt;h1\n    :class=\"important ? 'isImportant' : ''\"\n    @hover=\"hoverTitle\"\n  &gt;{{title}}&lt;\/h1&gt;\n&lt;\/template&gt;<\/pre>\n\n\n\n<p>\u4e16\u306e\u89e3\u8aac\u8a18\u4e8b\u3067\u306f TypeScript \u3092\u524d\u63d0\u306b\u3057\u305f\u8a18\u4e8b\u3082\u591a\u304f\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u4e8c\u3064\u306e\u30de\u30af\u30ed\u306f JavaScript \u304b TypeScript \u304b\u3067\u4f7f\u7528\u65b9\u6cd5\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e0a\u8a18\u3092 TypeScript \u3067\u66f8\u304d\u76f4\u3059\u3068\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted modBlobCode\">&lt;script setup lang=\"ts\"&gt;\ninterface Props {\n  title: string,\n  important?: boolean\n}\nconst props = defineProps&lt;Props&gt;();\nconst emits = defineEmits&lt;{ (e: 'hoverTitle', value: Event): void }&gt;();\n&lt;\/script&gt;\n&lt;template&gt;\n  &lt;h1\n    :class=\"important ? 'isImportant' : ''\"\n    @hover=\"hoverTitle\"\n  &gt;{{title}}&lt;\/h1&gt;\n&lt;\/template&gt;<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u7b2c\u4e00\u5f15\u6570\u3067\u306f\u306a\u304f\u3001TypeScript \u306e\u578b\u5f15\u6570\u3092\u4e0a\u624b\u304f\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u3088\u308a\u5f37\u529b\u306b\u578b\u306e\u6069\u6075\u3092\u53d7\u3051\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">(\u4f59\u8ac7) https:\/\/ja.vuejs.org\/ \u21d4 https:\/\/v3.ja.vuejs.org\/ \u21d4 https:\/\/jp.vuejs.org\/<\/h4>\n\n\n\n<p>Vue.js \u306e\u65e5\u672c\u8a9e\u7248\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u78ba\u8a8d\u3057\u305f\u9650\u308a 3 \u7a2e\u985e\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u3001<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/ja.vuejs.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/ja.vuejs.org\/<\/a> (\u73fe\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8)<\/li><li><a href=\"https:\/\/v3.ja.vuejs.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/v3.ja.vuejs.org\/<\/a> (\u65e7 3.x \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8)<\/li><li><a href=\"https:\/\/jp.vuejs.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/jp.vuejs.org\/<\/a> (\u65e7 2.x \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8)<\/li><\/ul>\n\n\n\n<p>\u57fa\u672c\u7684\u306b\u306f\u4e00\u756a\u4e0a\u3092\u53c2\u7167\u3059\u308b\u306e\u304c\u826f\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u4e16\u306e\u8a18\u4e8b\u304b\u3089\u306e\u30ea\u30f3\u30af\u306f\u4e0a\u8a18 3 \u7a2e\u985e\u304c\u6df7\u5728\u3057\u3066\u3044\u308b\u306e\u3067\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/vuejs\/jp.vuejs.org\/issues\/1534\">https:\/\/github.com\/vuejs\/jp.vuejs.org\/issues\/1534<\/a><br>\u4f55\u6545\u5206\u304b\u308c\u3066\u3044\u308b\u306e\u304b\u306e\u7406\u7531\u3092\u63a2\u3057\u3066\u3044\u305f\u3089\u3053\u3093\u306a issue \u3092\u898b\u3064\u3051\u307e\u3057\u305f\u3002\u3084\u306f\u308a\u6c34\u9762\u4e0b\u3067\u8272\u3005\u82e6\u52b4\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u2026\u2026<\/p>\n\n\n\n<h4 class=\"wp-block-comcent-blog-headline01 modHeadline\">\u307e\u3068\u3081<\/h4>\n\n\n\n<p>\u6b74\u53f2\u306e\u9577\u3044\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306f\u6642\u4ee3\u306b\u3088\u3063\u3066\u6c42\u3081\u3089\u308c\u308b\u3082\u306e\u3001\u5bfe\u5fdc\u3059\u3079\u304d\u3082\u306e\u304c\u5909\u5316\u3057\u3066\u3044\u304f\u306e\u3067\u3001\u3069\u3046\u3057\u3066\u3082\u5909\u308f\u3063\u3066\u3044\u304f\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u306f\u30dd\u30b8\u30c6\u30a3\u30d6\u306b\u3068\u3089\u3048\u308b\u306e\u3067\u3042\u308c\u3070\u300c\u9032\u5316\u300d\u3067\u3059\u304c\u3001\u8ffd\u5f93\u3059\u308b\u306b\u306f\u6211\u3005\u958b\u767a\u8005\u3082\u5e38\u306b\u77e5\u8b58\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u3044\u304b\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u8868\u8a18\u3086\u308c\u306f\u5358\u306a\u308b\u65b9\u8a00\u3067\u306f\u306a\u304f\u3001\u305d\u308c\u305e\u308c\u306b\u5b58\u5728\u7406\u7531\u304c\u3042\u308a\u307e\u3059\u3002<br>\u5b66\u3073\u59cb\u3081\u306f\u8cc7\u6599\u63a2\u3057\u3092\u90aa\u9b54\u3059\u308b\u3082\u306e\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u304c\u3001\u4f59\u88d5\u304c\u3042\u308c\u3070\u8907\u6570\u306e\u66f8\u304d\u5206\u3051\u304c\u3067\u304d\u308b\u7406\u7531\u3092\u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u610f\u5916\u306a\u77e5\u8b58\u304c\u5f97\u3089\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u50d5\u306f\u307e\u3060 Vue.js \u3092\u4f7f\u7528\u3057\u59cb\u3081\u3066\u307e\u3060\u65e5\u304c\u6d45\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082 2 \u7cfb\u2192 3 \u7cfb\u306e\u904e\u6e21\u671f\u3092\u4f53\u9a13\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u305d\u3057\u3066\u3075\u3068\u3001\u6614\u306b\u66f8\u3044\u305f Vue.js \u306e\u30b3\u30fc\u30c9\u3092\u898b\u308b\u3068\u73fe\u5728\u306e\u30b3\u30fc\u30c9\u3068\u5927\u5206\u898b\u305f\u76ee\u304c\u9055\u3046\u3053\u3068\u306b\u6c17\u304c\u4ed8\u304d\u307e\u3059\u3002  [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":2146,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[76,124],"coauthors":[45],"class_list":["post-2144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-frontend","tag-javascript","tag-vue-js"],"author_meta":{"nickname":"N.Go","position":"\u30d7\u30ed\u30b0\u30e9\u30de\u30fc","icon_url":"https:\/\/comcent.co.jp\/blog\/images\/authorNg-150x150.png","author_url":"https:\/\/comcent.co.jp\/blog\/archives\/author\/noji\/"},"tag_names":["JavaScript","Vue.js"],"thumbnail_url":"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2023\/02\/noji-2023-02-01-blog-thumbnail-300x200.png","_links":{"self":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=2144"}],"version-history":[{"count":27,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2144\/revisions"}],"predecessor-version":[{"id":5082,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/2144\/revisions\/5082"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/media\/2146"}],"wp:attachment":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=2144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=2144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=2144"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/coauthors?post=2144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}