{"id":2093,"date":"2018-11-06T03:57:39","date_gmt":"2018-11-05T18:57:39","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2093"},"modified":"2018-11-06T03:57:39","modified_gmt":"2018-11-05T18:57:39","slug":"vue%e3%83%87%e3%82%a3%e3%83%ac%e3%82%af%e3%83%86%e3%82%a3%e3%83%96%e3%81%a7%e3%82%af%e3%83%aa%e3%83%83%e3%82%af%e3%81%a7%e6%95%b0%e5%ad%97%e5%85%a5%e5%8a%9b%e3%81%a7%e3%81%8d%e3%82%8b%e3%83%91","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2093","title":{"rendered":"Vue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u30af\u30ea\u30c3\u30af\u3067\u6570\u5b57\u5165\u529b\u3067\u304d\u308b\u30d1\u30cd\u30eb\u3092\u3064\u304f\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dPython\u3084Electron\u306e\u8a18\u4e8b\u3092\u91cd\u70b9\u7684\u306b\u304a\u5c4a\u3051\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3042\u308b\u958b\u767a\u3067\u5fc5\u8981\u3068\u306a\u308b\u6a5f\u80fd\u304c\u3042\u3063\u305f\u306e\u3067\u4eca\u56de\u306fVue\u306e\u304a\u8a71\u3092\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u6a5f\u80fd\u3068\u306f\u3001\u305a\u3070\u308a\u300c\u30af\u30ea\u30c3\u30af\u3067\u6570\u5b57\u5165\u529b\u304c\u3067\u304d\u308b<code>&lt;input&gt;<\/code>\u30bf\u30b0\u300d\u3067\u3059\u3002<\/p>\n<p>\u306a\u305c\u304b\u3068\u3044\u3046\u3068\u3001\u4f8b\u3048\u3070\u91d1\u984d\u3092\u5165\u529b\u3059\u308b\u5834\u5408\u306b\u306f\u3044\u3061\u3044\u3061\u30de\u30a6\u30b9\u304b\u3089\u30ad\u30fc\u30dc\u30fc\u30c9\u306b\u624b\u3092\u79fb\u52d5\u3055\u305b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u4e0a\u306b\u3001\u30c6\u30f3\u30ad\u30fc\u5165\u529b\u3084\u6570\u5b57\u30ad\u30fc\u306f\u6163\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u4f5c\u696d\u306e\u30b9\u30d4\u30fc\u30c9\u611f\u304c\u5931\u308f\u308c\u3066\u3057\u307e\u3046\u304b\u3089\u3067\u3059\u3002\uff08\u305f\u307e\u306b<code>NumLock<\/code>\u306e\u305b\u3044\u3067\u5165\u529b\u304c\u304a\u304b\u3057\u304f\u306a\u3063\u305f\u308a\u3082\u3057\u307e\u3059 ^^;\uff09<\/p>\n<p>\u3082\u3061\u308d\u3093\u6587\u5b57\u3092\u5165\u529b\u3059\u308b\u5834\u5408\u306f\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u4f7f\u308f\u3056\u308b\u3092\u5f97\u307e\u305b\u3093\u304c\u3001\u6570\u5b57\u3063\u3066<code>\uff10\u301c\uff19<\/code>\u306e\uff11\uff10\u500b\u3060\u3051\u306a\u306e\u3067\u3001\u306a\u3093\u3068\u304b\u753b\u9762\u4e0a\u306e\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3067\u5165\u529b\u3057\u305f\u304b\u3063\u305f\u308a\u3059\u308b\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u767d\u7fbd\u306e\u77e2\u304c\u7acb\u3063\u305f\u306e\u304cVue\u306e\u72ec\u81ea\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u524d\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=1943\">Vue Component \u3067\u548c\u66a6\u304b\u3089\u897f\u66a6\u306b\u5909\u63db\u3059\u308b\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u3064\u304f\u308b<\/a>\u306e\u3088\u3046\u306b\u4eca\u56de\u3082Vue\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3082\u826f\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3060\u3068\u30af\u30e9\u30b9\u3084\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u306e\u9069\u7528\u304c\u6bd4\u8f03\u7684\u96e3\u3057\u304f\u306a\u308b\u305f\u3081\u3001\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u63a1\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u306f\u3058\u3081\u306bVue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u57fa\u672c\u7684\u306a\u8aac\u660e\u3082\u8f09\u305b\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u5b66\u7fd2\u8005\u3055\u3093\u306f\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002\uff08\u6700\u5f8c\u306b\u4eca\u56de\u306e\u6559\u6750\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1419 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/10\/10.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/10\/10.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/10\/10-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/p>\n<h1>Vue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3068\u306f\uff1f<\/h1>\n<p>\u307e\u305a\u306f\u57fa\u672c\u7684\u306a\u5185\u5bb9\u304b\u3089\u3002\uff08\u3059\u3067\u306b\u77e5\u3063\u3066\u3044\u308b\u65b9\u306f\u6b21\u306e\u9805\u76ee\u307e\u3067\u8aad\u307f\u98db\u3070\u3057\u3066\u304f\u3060\u3055\u3044\uff01\uff09<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30c6\u30ad\u30b9\u30c8\u306e\u6587\u5b57\u3092\u8d64\u3044\u8272\u306b\u3057\u305f\u3044\u5834\u5408\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;div <strong>v-red<\/strong>&gt;\u8d64\u3044\u6587\u5b57\u306b\u306a\u308a\u307e\u3059\u3002&lt;\/div&gt;<\/pre>\n<p>\u3053\u306e\u5834\u5408\u306f<code>v-red<\/code>\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u306b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>Vue.directive('red', {<\/strong>\r\n<strong>    bind: function(el) {<\/strong>\r\n\r\n<strong>        el.style.color = '#ff0000';<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n<strong>});<\/strong><\/pre>\n<p>\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3001\u4f7f\u3044\u56de\u3057\u304c\u3067\u304d\u308b\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u304c\u5b8c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2094\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/vue_directive_red_1.png\" alt=\"\" width=\"161\" height=\"36\" \/><\/p>\n<p>\u3082\u3061\u308d\u3093\u4f7f\u3048\u308b\u306e\u306f\u3001\u3072\u3068\u3064\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u6b21\u306e\u3088\u3046\u306b\u4f7f\u3044\u305f\u3044\u5834\u6240\u3067\u3069\u3053\u3067\u3082\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>&lt;div <strong>v-red<\/strong>&gt;\u8d64\u3044\u6587\u5b57\u306b\u306a\u308a\u307e\u3059\u3002&lt;\/div&gt;\r\n&lt;div <strong>v-red<\/strong>&gt;\u3053\u3053\u3082\u8d64\u3044\u6587\u5b57\u306b\u306a\u308a\u307e\u3059\u3002&lt;\/div&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2095\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/vue_directive_red_2.png\" alt=\"\" width=\"198\" height=\"47\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001CSS\u3060\u3051\u3067\u306a\u304f\u3001JavaScript\u3067\u3067\u304d\u308b\u3053\u3068\u306a\u3089\u306a\u3093\u3067\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30af\u30ea\u30c3\u30af\u3057\u305f\u3089\u300c\u8d64\u3044\u6587\u5b57\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u307e\u3057\u305f\uff01\u300d\u3068\u30a2\u30e9\u30fc\u30c8\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u65b0\u3057\u304f<code>v-red-click<\/code>\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u6b21\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>Vue.directive('red-click', {<\/strong>\r\n<strong>    bind: function(el) {<\/strong>\r\n\r\n<strong>        el.addEventListener('click', function() {<\/strong>\r\n\r\n<strong>            alert('\u8d64\u3044\u6587\u5b57\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u307e\u3057\u305f\uff01');<\/strong>\r\n\r\n<strong>        });<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n<strong>});<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u5148\u307b\u3069\u306e<code>v-red<\/code>\u304c\u3064\u3044\u3066\u3044\u308bdiv\u30bf\u30b0\u306b\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;div v-red <strong>v-red-click<\/strong>&gt;\u8d64\u3044\u6587\u5b57\u306b\u306a\u308a\u307e\u3059\u3002&lt;\/div&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2094\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/vue_directive_red_1.png\" alt=\"\" width=\"161\" height=\"36\" \/><\/p>\n<p>\u8868\u793a\u306f\u3055\u3063\u304d\u3068\u5909\u308f\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u308c\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2096\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-06-01-21-00.png\" alt=\"\" width=\"443\" height=\"131\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-06-01-21-00.png 443w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-06-01-21-00-300x89.png 300w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/p>\n<p>\u306f\u3044\u3001\u3054\u60f3\u50cf\u306e\u3068\u304a\u308a\u30a2\u30e9\u30fc\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001Vue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b\u306f\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306b\u30a2\u30e9\u30fc\u30c8\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>&lt;div v-red <strong>v-red-click=\"{text: '\u9752\u3044\u6587\u5b57\u3082\u3044\u3044\u3088\u306d\uff01'}\"<\/strong>&gt;\u8d64\u3044\u6587\u5b57\u306b\u306a\u308a\u307e\u3059\u3002&lt;\/div&gt;<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001\u72ec\u81ea\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>Vue.directive('red-click', {\r\n    bind: function(el, <strong>binding<\/strong>) {\r\n\r\n        el.addEventListener('click', function() {\r\n\r\n            alert(<strong>binding.value.text<\/strong>);\r\n\r\n        });\r\n\r\n    }\r\n});<\/pre>\n<p>\u3064\u307e\u308a\u3001<code>bind<\/code>\u306b\u5148\u307b\u3069\u306e\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3053\u304b\u3089\u547c\u3073\u51fa\u3059\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093<code>style<\/code>\u3084<code>class<\/code>\u3068\u306e\u5171\u5b58\u3082\u3067\u304d\u308b\u306e\u3067\u3001Vue\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3088\u308a\u30c7\u30b6\u30a4\u30f3\u7684\u306b\u306f\u3088\u308a\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u3068\u3044\u3063\u3066\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;div <strong>style=\"background:#ccc;\"<\/strong> v-red v-red-click=\"{text: '\u9752\u3044\u6587\u5b57\u3082\u3044\u3044\u3088\u306d\uff01'}\"&gt;\u8d64\u3044\u6587\u5b57\u306b\u306a\u308a\u307e\u3059\u3002&lt;\/div&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2097\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/vue_directive_red_3.png\" alt=\"\" width=\"169\" height=\"39\" \/><\/p>\n<p>\u3068\u3001\u5c11\u3057\u524d\u7f6e\u304d\u304c\u9577\u304f\u306a\u308a\u307e\u3057\u305f\u304c\u3053\u308c\u304cVue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u3059\u3002<br \/>\n\u3067\u306f\u3001\u6b21\u304b\u3089\u306f\u672c\u984c\u306e\u6570\u5b57\u5165\u529b\u3067\u304d\u308b\u72ec\u81ea\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>\u30af\u30ea\u30c3\u30af\u3067\u6570\u5b57\u5165\u529b\u3067\u304d\u308bVue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u3064\u304f\u308b<\/h1>\n<h2>\u3084\u308a\u305f\u3044\u3053\u3068<\/h2>\n<p>\u4eca\u56de\u3064\u304f\u308b\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u5b9f\u73fe\u3057\u305f\u3044\u5185\u5bb9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>&lt;input&gt;\u30bf\u30b0\u304c\u9078\u629e\u3055\u308c\u305f\u3089\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u8868\u793a<\/li>\n<li>\u30af\u30ea\u30c3\u30af\u3067\u6570\u5b57\u304c\u5165\u529b\u3067\u304d\u308b<\/li>\n<li>\u30af\u30ea\u30a2\u30dc\u30bf\u30f3\u3082\u3064\u3051\u308b<\/li>\n<li>\u9589\u3058\u308b\u30dc\u30bf\u30f3\u3082\u3064\u3051\u308b<\/li>\n<li>\u30d5\u30a9\u30fc\u30ab\u30b9\u304c\u5916\u308c\u305f\u3089\u81ea\u52d5\u7684\u306b\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u306f\u6d88\u3048\u308b<\/li>\n<li>\u5165\u529b\u3055\u308c\u305f\u4f4d\u7f6e\u306b\u6570\u5b57\u3092\u5165\u529b\uff08\u9078\u629e\u3055\u308c\u3066\u3044\u305f\u3089\u3001\u524a\u9664\u3057\u3066\u305d\u3053\u306b\u5165\u529b\uff09<\/li>\n<li>\u30cf\u30a4\u30d5\u30f3\u3084\u30a2\u30b9\u30bf\u30ea\u30b9\u30af\u306a\u3069\u3001\u305d\u306e\u4ed6\u306e\u6587\u5b57\u3082\u8ffd\u52a0\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>\u898b\u305f\u76ee\u3067\u3044\u3046\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2099\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-06-01-32-37.png\" alt=\"\" width=\"217\" height=\"101\" \/><\/p>\n<h2>\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u57fa\u672c\u3092\u3064\u304f\u308b<\/h2>\n<p>\u307e\u305a\u306f\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u57fa\u672c\u5f62\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u540d\u524d\u306f<code>number-panel<\/code>\u3067\u3059\u3002<\/p>\n<pre>Vue.directive('<strong>number-panel<\/strong>', {\r\n    bind: function(el, binding) {\r\n\r\n        \/\/ \u3053\u3053\u306b\u30b3\u30fc\u30c9\r\n\r\n\u00a0   }\r\n});<\/pre>\n<p>\u3064\u307e\u308a\u3001\u3053\u306e\u3088\u3046\u306a\u5f62\u3067\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;input type=\"text\" <strong>v-number-panel<\/strong>&gt;<\/pre>\n<h2>\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u90e8\u5206\u3092\u3064\u304f\u308b<\/h2>\n<p>\u6b21\u306b\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u4f5c\u308b\u90e8\u5206\u3067\u3059\u304c\u3001\u3053\u306e\u90e8\u5206\u306f\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u304c\u8907\u6570\u547c\u3073\u51fa\u3055\u308c\u3066\u3082\u3001\u7d50\u5c40\u306f\u3072\u3068\u3064\u3060\u3051\u3042\u308c\u3070\u5341\u5206\u306a\u306e\u3067\u3001\u65e2\u306b\u4f5c\u6210\u6e08\u307f\u306e\u5834\u5408\u306f\u6b21\u306e\u3088\u3046\u306b\u51e6\u7406\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n<pre>Vue.directive('number-panel', {\r\n    bind: function(el, binding) {\r\n\r\n<strong>        var panelId = 'vue-number-panel';<\/strong>\r\n\r\n<strong>        if(document.getElementById(panelId) == null) {<\/strong>\r\n\r\n<strong>            \/\/ \u300c\u3072\u3068\u3064\u3060\u3051\u3064\u304f\u308b\u90e8\u5206\u300d<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n    }\r\n});<\/pre>\n<p>\u306a\u304a\u3001\u3053\u3053\u304b\u3089\u306e\u5404\u30d6\u30ed\u30c3\u30af\u3067\u524d\u5f8c\u3057\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u90e8\u5206\u3092\u300c\u3072\u3068\u3064\u3060\u3051\u3064\u304f\u308b\u90e8\u5206\u300d\u3068\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b\uff08\u3072\u3068\u3064\u3060\u3051\u3064\u304f\u308b\u90e8\u5206\uff09<\/h3>\n<p>\u307e\u305a\u306f\u6570\u5b57\u3068\u30af\u30ea\u30a2\u3001\u305d\u3057\u3066\u9589\u3058\u308b\u30dc\u30bf\u30f3\u3092\u4f5c\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre><strong>var panelButtons = [];<\/strong>\r\n<strong>var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];<\/strong>\r\n\r\n<strong>for(var i in numbers) {<\/strong>\r\n\r\n<strong>    var number = numbers[i];<\/strong>\r\n<strong>    panelButtons.push('&lt;button class=\"vue-number-panel-button\" input=\"'+ number +'\"&gt;'+ number +'&lt;\/button&gt;');<\/strong>\r\n\r\n<strong>}<\/strong>\r\n\r\n<strong>if(binding.value &amp;&amp; typeof binding.value.extraInputs == 'object') {<\/strong>\r\n\r\n<strong>    for(var key in binding.value.extraInputs) {<\/strong>\r\n\r\n<strong>        var text = binding.value.extraInputs[key];<\/strong>\r\n<strong>        panelButtons.push('&lt;button class=\"vue-number-panel-button\" input=\"'+ key +'\"&gt;'+ text +'&lt;\/button&gt;');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>}<\/strong>\r\n\r\n<strong>panelButtons.push('&lt;button class=\"vue-number-panel-button\" input=\"c\"&gt;c&lt;\/button&gt;');<\/strong>\r\n<strong>panelButtons.push('&lt;button class=\"vue-number-panel-button\" input=\"x\"&gt;&amp;times;&lt;\/button&gt;');<\/strong><\/pre>\n<p><code>panelButtons<\/code>\u3068\u3044\u3046\u914d\u5217\u306b\u3072\u3068\u3064\u305a\u3064\u5fc5\u8981\u3068\u306a\u308b\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code>&lt;button&gt;<\/code>\u30bf\u30b0\u306e\u4e2d\u306b\u3042\u308b<code>input<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u4e2d\u8eab\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\uff10\u301c\uff19\u3000\u30fb\u30fb\u30fb\u3000\u5165\u529b\u3059\u308b\u6570\u5b57<\/li>\n<li>c\u3000\u30fb\u30fb\u30fb\u3000\u30af\u30ea\u30a2<\/li>\n<li>x\u3000\u30fb\u30fb\u30fb\u3000\u9589\u3058\u308b<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001<code>binding.value.extraInputs<\/code>\u306e\u90e8\u5206\u3067\u306f\u3001\u72ec\u81ea\u306e\u5165\u529b\u304c\u3067\u304d\u308b\u30dc\u30bf\u30f3\uff08\u4f8b\u3048\u3070\u96fb\u8a71\u756a\u53f7\u5165\u529b\u306e\u5834\u5408\u306b\u300c-\u300d\u306a\u3069\uff09\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u6b21\u306e\u3088\u3046\u306b\u3059\u308b\u3068\u30dc\u30bf\u30f3\u304c\u5897\u3048\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;input type=\"text\" <strong>v-number-panel=\"numberPanelOptions\"<\/strong>&gt;<\/pre>\n<pre>new Vue({\r\n    el: '#app',\r\n    data: {\r\n        <strong>numberPanelOptions: {<\/strong>\r\n<strong>            extraInputs: {<\/strong>\r\n<strong>                '-': '\u30cf\u30a4\u30d5\u30f3',<\/strong>\r\n<strong>                '*': '\u30a2\u30b9\u30bf\u30ea\u30b9\u30af'<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        }<\/strong>\r\n    }\r\n});<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2101\" style=\"border: 1px solid #ccc;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/Screenshot-from-2018-11-06-02-49-12.png\" alt=\"\" width=\"214\" height=\"114\" \/><\/p>\n<h3>\u672c\u4f53\u3092\u3064\u304f\u308b\uff08\u3072\u3068\u3064\u3060\u3051\u3064\u304f\u308b\u90e8\u5206\uff09<\/h3>\n<p>\u3067\u306f\u6b21\u306b\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u672c\u4f53\u306eHTML\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>var panel = document.createElement('div');<\/strong>\r\n<strong>panel.id = panelId;<\/strong>\r\n<strong>panel.innerHTML = '&lt;div&gt;'+ panelButtons.join('') +'&lt;\/div&gt;';<\/strong>\r\n<strong>panel.style.display = 'none';<\/strong>\r\n<strong>panel.style.position = 'absolute';\r\n\r\ndocument.body.appendChild(panel);\r\n<\/strong><\/pre>\n<p><code>createElement<\/code>\u3067<code>div<\/code>\u30bf\u30b0\u3092\u4f5c\u308a\u3001\u3055\u3063\u304d\u306e\u30dc\u30bf\u30f3\u3092\u7d50\u5408\u3057\u3066HTML\u5316\u3002\u305d\u3057\u3066\u3001CSS\u3092\u8a2d\u5b9a\u3057\u3066<code>body<\/code>\u30bf\u30b0\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<h3>\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306b\u30d5\u30a9\u30fc\u30ab\u30b9\u3055\u308c\u305f\u6642\u306e\u30b3\u30fc\u30c9\u3092\u3064\u304f\u308b<\/h3>\n<p>\u3067\u306f\u3001\u7d9a\u3044\u3066<code>v-number-panel<\/code>\u304c\u4ed8\u3051\u3089\u308c\u305f\u5165\u529b\u30dc\u30c3\u30af\u30b9\u304c\u9078\u629e\u3055\u308c\u305f\uff08\u30d5\u30a9\u30fc\u30ab\u30b9\u3055\u308c\u305f\uff09\u6642\u306e\u30b3\u30fc\u30c9\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>var randomKey = Date.now() +'-'+ Math.random().toString(36).substring(7);<\/strong>\r\n\r\n<strong>el.setAttribute('vue-number-panel-input', randomKey);<\/strong>\r\n<strong>el.addEventListener('focus', function(e) {<\/strong>\r\n\r\n<strong>    var rect = e.target.getBoundingClientRect();<\/strong>\r\n<strong>    var top = rect.top;<\/strong>\r\n<strong>    var left = rect.left;<\/strong>\r\n<strong>    var width = rect.width;<\/strong>\r\n<strong>    var height = rect.height;<\/strong>\r\n<strong>    var scrollTop  = window.pageYOffset || document.documentElement.scrollTop;<\/strong>\r\n<strong>    var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;<\/strong>\r\n<strong>    var panel = document.getElementById(panelId);<\/strong>\r\n<strong>    panel.style.top = (top+height+scrollTop) +'px';<\/strong>\r\n<strong>    panel.style.left = (left+scrollLeft) +'px';<\/strong>\r\n<strong>    panel.style.width = width +'px';<\/strong>\r\n<strong>    panel.style.minWidth = '150px';<\/strong>\r\n<strong>    panel.style.display = 'block';<\/strong>\r\n<strong>    panel.style.zIndex = '10000';<\/strong>\r\n<strong>    panel.setAttribute('input-id', e.target.getAttribute('vue-number-panel-input'))<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u307e\u305a\uff11\u884c\u76ee\u3067\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u3092\u3064\u304f\u308a\u3001\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306e<code>vue-number-panel-input<\/code>\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3092\u8b58\u5225\u3059\u308bID\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>focus<\/code>\u30a4\u30d9\u30f3\u30c8\u306e\u4e2d\u3067\u30d5\u30a9\u30fc\u30ab\u30b9\u3055\u308c\u305f\u3068\u304d\u306b\u3001\u305d\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3057\u3066\u3001\u5148\u307b\u3069\u306e\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u304c\u3059\u3050\u4e0b\u306b\u304f\u308b\u3088\u3046\u306bCSS\u3092\u64cd\u4f5c\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u5148\u307b\u3069\u306eID\u3092\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u306e<code>input-id<\/code>\u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n<h3>\u9078\u629e\u4e2d\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\u3092\u3064\u304f\u308b<\/h3>\n<p>\u30b3\u30fc\u30c9\u3092\u3088\u308a\u5c11\u306a\u304f\u3059\u308b\u305f\u3081\u306b\u3001\u5171\u901a\u90e8\u5206\u3092\u95a2\u6570\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<br \/>\n\u6b21\u306e\u30b3\u30fc\u30c9\u3067\u306f<code>panel<\/code>\u3001\u3064\u307e\u308a\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u306b\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\u5165\u529b\u30dc\u30c3\u30af\u30b9ID\u3092\u53d6\u5f97\u3057\u3001\u305d\u306eID\u3092\u3092\u4f7f\u3063\u3066\u9078\u629e\u4e2d\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>var getTargetInput = function() {<\/strong>\r\n\r\n<strong>    var panel = document.getElementById(panelId);<\/strong>\r\n<strong>    var targetInputId = panel.getAttribute('input-id');<\/strong>\r\n<strong>    return document.querySelector('[vue-number-panel-input=\"'+ targetInputId +'\"]');<\/strong>\r\n\r\n<strong>};<\/strong><\/pre>\n<p>\u203b Vue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u81ea\u4f53\u306b\u529b\u6280\u3067\u30e1\u30bd\u30c3\u30c9\u3092\u767b\u9332\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u3042\u307e\u308a\u30b9\u30de\u30fc\u30c8\u3067\u306f\u306a\u3044\u306e\u3067\u3053\u306e\u5f62\u3092\u63a1\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3068\u304d\u306e\u30b3\u30fc\u30c9\u3092\u4f5c\u308b\uff08\u3072\u3068\u3064\u3060\u3051\u3064\u304f\u308b\u90e8\u5206\uff09<\/h3>\n<p>\u3067\u306f\u3001<code>getTargetInput()<\/code>\u3092\u4f7f\u3063\u3066\u3001\u30dc\u30bf\u30f3\u306e\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>var buttons = document.getElementsByClassName('vue-number-panel-button');<\/strong>\r\n\r\n<strong>for(var i = 0; i &lt; buttons.length; i++) {<\/strong>\r\n\r\n<strong>    var button = buttons[i];<\/strong>\r\n<strong>    var input = button.getAttribute('input');<\/strong>\r\n\r\n<strong>    if(input == 'c') {<\/strong>\r\n\r\n<strong>        \/\/ input\u304c\u300cc\u300d\u306e\u5834\u5408<\/strong>\r\n\r\n<strong>    } else if(input == 'x') {<\/strong>\r\n\r\n<strong>        \/\/ input\u304c\u300cx\u300d\u306e\u5834\u5408<\/strong>\r\n\r\n<strong>    } else {<\/strong>\r\n\r\n<strong>        \/\/ \u6570\u5b57\uff08\u3068\u305d\u306e\u4ed6\u306e\u6587\u5b57\uff09\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u307e\u305a\uff11\u884c\u76ee\u3067\u5168\u30dc\u30bf\u30f3\u3092\u53d6\u5f97\u3057\u3066\u3001\u30eb\u30fc\u30d7\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>input<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5185\u5bb9\u306b\u3088\u3063\u3066\u5206\u5c90\u3057\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>input\u304c\u300cc\u300d\u306e\u5834\u5408<\/h3>\n<p>\u30af\u30ea\u30a2\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642\u306e\u30a4\u30d9\u30f3\u30c8\u3067\u3059\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u9078\u629e\u4e2d\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3001\u4e2d\u8eab\u3092\u7a7a\u767d\u306b\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3078\u30d5\u30a9\u30fc\u30ab\u30b9\u3092\u623b\u3057\u3001\u6700\u5f8c\u306b\u5909\u66f4\u3055\u308c\u305f\u3053\u3068\u3092\u77e5\u3089\u305b\u308b<code>input<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>button.addEventListener('click', function() {<\/strong>\r\n\r\n<strong>    var targetInput = getTargetInput(panelId);<\/strong>\r\n<strong>    targetInput.value = '';<\/strong>\r\n<strong>    targetInput.focus();<\/strong>\r\n<strong>    targetInput.dispatchEvent(new Event('input'));<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<h3>input\u304c\u300cx\u300d\u306e\u5834\u5408<\/h3>\n<p>\u9589\u3058\u308b\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<br \/>\nCSS\u3092\u64cd\u4f5c\u3057\u3066\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u6d88\u3059\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre><strong>button.addEventListener('click', function() {<\/strong>\r\n\r\n<strong>    var panel = document.getElementById(panelId);<\/strong>\r\n<strong>    panel.style.display = 'none';<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<h3>\u6570\u5b57\uff08\u3068\u305d\u306e\u4ed6\u306e\u6587\u5b57\uff09\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u6642<\/h3>\n<p>\u6700\u5f8c\u306b\u6570\u5b57\u3068\u30e6\u30fc\u30b6\u30fc\u306b\u3088\u3063\u3066\u8ffd\u52a0\u3055\u308c\u305f\u6587\u5b57\u3092\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3078\u4ee3\u5165\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<pre><strong>button.addEventListener('click', function(e) {<\/strong>\r\n\r\n<strong>    var input = e.target.getAttribute('input');<\/strong>\r\n<strong>    var targetInput = getTargetInput(panelId);<\/strong>\r\n<strong>    var currentValue = targetInput.value;<\/strong>\r\n<strong>    var selectionStart = targetInput.selectionStart;<\/strong>\r\n<strong>    var selectionEnd = targetInput.selectionEnd;<\/strong>\r\n\r\n<strong>    if(selectionStart != selectionEnd) {<\/strong>\r\n\r\n<strong>        currentValue = [<\/strong>\r\n<strong>            currentValue.substring(0, selectionStart),<\/strong>\r\n<strong>            currentValue.substring(selectionEnd)<\/strong>\r\n<strong>        ].join('');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    var newValues = [<\/strong>\r\n<strong>        currentValue.substring(0, selectionStart),<\/strong>\r\n<strong>        input,<\/strong>\r\n<strong>        currentValue.substring(selectionStart)<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    targetInput.value = newValues.join('');<\/strong>\r\n<strong>    targetInput.focus();<\/strong>\r\n<strong>    targetInput.selectionStart = selectionStart + 1;<\/strong>\r\n<strong>    targetInput.selectionEnd = selectionStart + 1;<\/strong>\r\n<strong>    targetInput.dispatchEvent(new Event('input'));<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u307e\u305a\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u30dc\u30bf\u30f3\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u5165\u529b\u3059\u3079\u304d\u6570\u5b57\uff08\u3082\u3057\u304f\u306f\u6587\u5b57\uff09\u3092\u53d6\u5f97\u3057\u3001\u9078\u629e\u4e2d\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u304b\u3089\u73fe\u5728\u306e\u5165\u529b\u4f4d\u7f6e\uff08\u3064\u307e\u308a\u30ad\u30e3\u30ec\u30c3\u30c8\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3068\u304d\u3001\u3082\u3057\u30ad\u30e3\u30ec\u30c3\u30c8\u306e\u958b\u59cb\u3068\u7d42\u4e86\u304c\u9055\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u4e00\u90e8\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u90e8\u5206\u3092\u524a\u9664\u3002\u305d\u3057\u3066\u3001\u958b\u59cb\u4f4d\u7f6e\u306b\u5165\u529b\u3059\u3079\u304d\u6570\u5b57\u3092\u633f\u5165\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u6b21\u306e\u3088\u3046\u306b\u300c234\u300d\u304c\u9078\u629e\u4e2d\u3067\u300c9\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u5834\u5408\u306e\u6319\u52d5\u306f\u3001<\/p>\n<p><code>1<strong>234<\/strong>5<\/code><\/p>\n<p>\u307e\u305a\u300c234\u300d\u3092\u524a\u9664\u3057\u3066<\/p>\n<p><code>15<\/code><\/p>\n<p>\u306b\u3057\u3001\u3055\u3089\u306b\u300c1\u300d\u3068\u300c5\u300d\u306e\u9593\u306b\u300c9\u300d\u3092\u633f\u5165\u3057\u3066\u6700\u7d42\u7684\u306b<\/p>\n<p><code>195<\/code><\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u304c\u7d42\u308f\u308c\u3070\u3001\u65b0\u3057\u3044\u5024\u3092\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306b\u4ee3\u5165\u3057\u3001\u6587\u5b57\u6570\u304c\u5909\u66f4\u306b\u306a\u3063\u305f\u306e\u3067\u30ad\u30e3\u30ec\u30c3\u30c8\u4f4d\u7f6e\u3082\u5909\u66f4\u3001\u6700\u5f8c\u306b<code>input<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u51fa\u3057\u3066\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h2>\u30d5\u30a9\u30fc\u30ab\u30b9\u304c\u306f\u305a\u308c\u305f\u3089\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u6d88\u3059\u30b3\u30fc\u30c9\uff08\u3072\u3068\u3064\u3060\u3051\u3064\u304f\u308b\u90e8\u5206\uff09<\/h2>\n<p>\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u6d88\u3059\u306b\u306f\u3001\u5ff5\u306e\u70ba\u306b\u9589\u3058\u308b\u30dc\u30bf\u30f3\u3092\u3064\u304f\u3063\u3066\u3042\u308a\u307e\u3059\u304c\u3001\u3044\u3061\u3044\u3061\u72ed\u3044\u90e8\u5206\u3092\u30af\u30ea\u30c3\u30af\u3057\u306a\u3044\u3068\u6d88\u3048\u306a\u3044\u3088\u3046\u3067\u306f\u30e6\u30fc\u30b6\u30fc\u30d3\u30ea\u30c6\u30a3\u304c\u3044\u3044\u3068\u306f\u3044\u3048\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u30d5\u30a9\u30fc\u30ab\u30b9\u304c\u5916\u308c\u305f\u3089\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u81ea\u52d5\u7684\u306b\u6d88\u3059\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001\u3053\u3053\u3067\u3072\u3068\u3064\u5de5\u592b\u3092\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306b<code>blur<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u3051\u3066\u3053\u306e\u4e2d\u3067\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u3092\u6d88\u3059\u3088\u3046\u306b\u3057\u305f\u3060\u3051\u3067\u306f\u3001\u6570\u5b57\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u6642\u70b9\u3067<code>blur<\/code>\u30a4\u30d9\u30f3\u30c8\u304c\u5b9f\u884c\u3055\u308c\u3001\u300c\u307e\u3060\u5165\u529b\u306e\u9014\u4e2d\u306a\u306e\u306b\u30ad\u30fc\u30dc\u30fc\u30c9\u304c\u6d88\u3048\u3066\u3057\u307e\u3063\u305f\uff01\u300d\u3068\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u306b<code>mouseenter<\/code>\u3068<code>mouseleave<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u3064\u3051\u3001\u5165\u529b\u4e2d\u304b\u3069\u3046\u304b\u3092\u5224\u65ad\u3067\u304d\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>panel.addEventListener('mouseenter', function(e){<\/strong>\r\n\r\n<strong>    e.target.setAttribute('mouse-hover', 'yes');<\/strong>\r\n\r\n<strong>});<\/strong>\r\n<strong>panel.addEventListener('mouseleave', function(e){<\/strong>\r\n\r\n<strong>    e.target.setAttribute('mouse-hover', '');<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u3053\u308c\u306f\u3001\u30de\u30a6\u30b9\u304c\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u4e2d\u306b\u5165\u3063\u3066\u304d\u305f\u3089\u3001\uff08\u3064\u307e\u308a\u5165\u529b\u4e2d\uff09<code>mouse-hoever<\/code>\u3092<code>yes<\/code>\u306b\u3057\u3001\u30de\u30a6\u30b9\u304c\u51fa\u3066\u3044\u3063\u305f\u3089\u3001\u7a7a\u767d\u306b\u3059\u308b\u3068\u3044\u3046\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u3048\u3070\u3001<code>blur<\/code>\u30a4\u30d9\u30f3\u30c8\u3067\u30d0\u30fc\u30c1\u30e3\u30eb\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u8aa4\u6d88\u53bb\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>el.addEventListener('blur', function() {\r\n\r\n    <strong>var panel = document.getElementById(panelId);<\/strong>\r\n<strong>    var mouseHover = panel.getAttribute('mouse-hover');<\/strong>\r\n\r\n<strong>    if(mouseHover != 'yes') {<\/strong>\r\n\r\n<strong>        panel.style.display = 'none';<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n});<\/pre>\n<p><code>panel<\/code>\u304b\u3089\u5148\u307b\u3069\u306e<code>mouse-hover<\/code>\u3092\u53d6\u5f97\u3057\u3066\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>GitHub\u306b\u30a2\u30c3\u30d7\u3057\u307e\u3057\u305f<\/h1>\n<p>\u4eca\u5f8c\u306e\u958b\u767a\u3067\u3082\u4f7f\u3048\u305d\u3046\u3060\u3063\u305f\u306e\u3067\u3001GitHub\u306b\u30a2\u30c3\u30d7\u3057\u3066\u304a\u304d\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/SUKOHI\/v-number-panel\">https:\/\/github.com\/SUKOHI\/v-number-panel<\/a><\/p>\n<h1>\u6559\u6750\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059<\/h1>\n<p>\u4eca\u56de\u5b9f\u969b\u306b\u958b\u767a\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092\u4ee5\u4e0b\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5c55\u958b\u3057\u3066\u3001<code>index.html<\/code>\u3092\u30d6\u30e9\u30a6\u30b6\u3067\u958b\u304f\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/blog.capilano-fw.com?download=2102&amp;tmstv=1777606379\" rel=\"nofollow\" id=\"download-link-2102\" data-redirect=\"false\" >\n\tVue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\uff1a \u30af\u30ea\u30c3\u30af\u3067\u6570\u5b57\u5165\u529b\u3067\u304d\u308b\u30d1\u30cd\u30eb\u3092\u3064\u304f\u308b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/a>\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dPython\u3084Electron\u306e\u8a18\u4e8b\u3092\u91cd\u70b9\u7684\u306b\u304a\u5c4a\u3051\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3042\u308b\u958b\u767a\u3067\u5fc5\u8981\u3068\u306a\u308b\u6a5f\u80fd\u304c\u3042\u3063\u305f\u306e\u3067\u4eca\u56de\u306fVue\u306e\u304a\u8a71\u3092\u3059\u308b\u3053\u3068\u306b\u3057\u307e &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2093\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Vue\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u30af\u30ea\u30c3\u30af\u3067\u6570\u5b57\u5165\u529b\u3067\u304d\u308b\u30d1\u30cd\u30eb\u3092\u3064\u304f\u308b\u65b9\u6cd5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":2108,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[104],"class_list":["post-2093","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vue-js","tag-vue-directive"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2093"}],"version-history":[{"count":10,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2093\/revisions"}],"predecessor-version":[{"id":2113,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2093\/revisions\/2113"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/2108"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}