{"id":4783,"date":"2019-10-23T19:10:14","date_gmt":"2019-10-23T10:10:14","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=4783"},"modified":"2020-04-23T05:27:22","modified_gmt":"2020-04-22T20:27:22","slug":"%e3%80%90vue%ef%bc%86latavel%e3%80%91%e5%85%a5%e5%8a%9b-or-%e9%81%b8%e6%8a%9e%e3%81%a7%e3%81%8d%e3%82%8b%e3%80%8cdatalist%e3%80%8d%e3%82%92%e4%bd%bf%e3%81%86%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=4783","title":{"rendered":"\u3010Vue\uff06Laravel\u3011\u5165\u529b or \u9078\u629e\u3067\u304d\u308b\u300cdatalist\u300d\u3092\u4f7f\u3046\u30b5\u30f3\u30d7\u30eb"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308d<code>Vue<\/code>\u306e\u8a18\u4e8b\u3092\u9023\u7d9a\u3057\u3066\u6295\u7a3f\u3057\u3066\u304d\u305f\u306e\u3067\u4eca\u56de\u306f\u5c11\u3057\u6c17\u5206\u3092\u5909\u3048\u3066\u3001\u3082\u3063\u3068\u6839\u672c\u7684\u306a\u5185\u5bb9\u3092\u304a\u5c4a\u3051\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u306f\u300cHTML 5\u300d\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u5b9f\u306f<code>HTML 5<\/code>\u304c\u516c\u958b\u3055\u308c\u305f\u3068\u304d\u306b\u8272\u3005\u3068\u65b0\u3057\u3044\u6a5f\u80fd\u304c\u8ffd\u52a0\u306b\u306a\u3063\u305f\u306e\u306f\u77e5\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u306a\u306b\u305b\u300cIE\u3060\u3051\u304c\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u307e\u305b\u3093\u30fb\u30fb\u30fb\ud83d\ude2b\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u591a\u304b\u3063\u305f\u306e\u3067\u30b9\u30eb\u30fc\u3057\u3066\u3044\u308b\u3082\u306e\u304c\u591a\u304b\u3063\u305f\u3093\u3067\u3059\u3002<\/p>\n<p>\u3067\u3082\u3001\u3053\u306e\u9593<code>&lt;datalist&gt;&lt;\/datalist&gt;<\/code>\u3068\u3044\u3046\u5165\u529b\u5019\u88dc\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u6a5f\u80fd\u3092\u3064\u304b\u3063\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u3068\u3066\u3082\u4fbf\u5229\u3067\u611f\u52d5\u3057\u307e\u3057\u305f\u3002\uff08<code>JavaScript<\/code>\u306e<code>select2<\/code>\u3068\u307b\u307c\u540c\u7b49\u306e\u6a5f\u80fd\u3067\u3059\uff09<\/p>\n<p>\u3057\u304b\u3082\u3001<a href=\"https:\/\/caniuse.com\/#search=datalist\" target=\"_blank\" rel=\"noopener noreferrer\">Can I use<\/a> \u3067\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d<code>datalist<\/code>\u306fIE 11\u3067\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u3093\u3067\u3059\uff01\uff08\u6ce8\u610f\u66f8\u304d\u306b\u306fIE\u306f\u4e00\u90e8\u306e\u307f\u5bfe\u5fdc\u3067\u3001&#8221;\u3059\u3063\u3054\u304f\u30d0\u30b0\u304c\u3042\u308b&#8221;\u3068\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u3061\u3087\u3063\u3068\u78ba\u8a8d\u3057\u305f\u9650\u308a\u305d\u3053\u307e\u3067\u304a\u304b\u3057\u306a\u6319\u52d5\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\uff09<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3053\u306e<code>&lt;datalist&gt;&lt;\/datalist&gt;<\/code>\u30bf\u30b0\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089<code>Laravel<\/code>\uff06<code>Vue<\/code>\u3067\u306e\u52d5\u7684\u306a\u4f7f\u3044\u65b9\u307e\u3067\u3092\u30b5\u30f3\u30d7\u30eb\u3068\u3057\u3066\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p>\u958b\u767a\u74b0\u5883\uff1a Laravel 6x\u3001Vue 2.6<\/p>\n<h1>\u307e\u305a\u306f\u4f53\u9a13\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044<\/h1>\n<p>\u3067\u306f<code>&lt;datalist&gt;&lt;\/datalist&gt;<\/code>\u304c\u3069\u3093\u306a\u3082\u306e\u304b\u4f53\u9a13\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u90fd\u9053\u5e9c\u770c\u3092\u5165\u529b or \u9078\u629e\u3067\u304d\u308b\u30dc\u30c3\u30af\u30b9\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u30d5\u30a9\u30fc\u30ab\u30b9\u3092\u5f53\u3066\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u90fd\u9053\u5e9c\u770c\u304c\u30ea\u30b9\u30c8\u8868\u793a\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><input list=\"prefs\" type=\"text\" \/><br \/>\n<datalist id=\"prefs\"><option value=\"\u6771\u4eac\u90fd\"><\/option><option value=\"\u5927\u962a\u5e9c\"><\/option><option value=\"\u798f\u5ca1\u770c\"><\/option><option value=\"\u5317\u6d77\u9053\"><\/option><\/datalist><\/p>\n<p>\u3055\u3089\u306b\u3053\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306b\u300c\u6771\u300d\u3068\u5165\u529b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3069\u3046\u3067\u3057\u3087\u3046\u3002<br \/>\n\u6771\u4eac\u90fd\u3060\u3051\u304c\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3055\u308c\u305f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3001\u4fbf\u5229\u3067\u3059\u3088\u306d\ud83d\ude0a\u2728<\/p>\n<h1>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h1>\n<p><code>datalist<\/code>\u306e\u4f7f\u3044\u65b9\u306f\u7c21\u5358\u3067\u3001\u901a\u5e38\u306e\u5165\u529b\u30dc\u30c3\u30af\u30b9\u306e<code>list<\/code>\u30d7\u30ed\u30d1\u30c6\u30a3\u306b<code>id<\/code>\u3092\u8a18\u8ff0\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre>&lt;input type=\"text\" <strong>list=\"todofuken_list\"<\/strong>&gt;\r\n&lt;datalist <strong>id=\"todofuken_list\"<\/strong>&gt;\r\n    &lt;option value=\"\u6771\u4eac\u90fd\"&gt;\r\n    &lt;option value=\"\u5927\u962a\u5e9c\"&gt;\r\n    &lt;option value=\"\u4eac\u90fd\u5e9c\"&gt;\r\n    &lt;option value=\"\u798f\u5ca1\u770c\"&gt;\r\n    &lt;option value=\"\u5317\u6d77\u9053\"&gt;\r\n&lt;\/datalist&gt;<\/pre>\n<p>\u203b <code>todofuken_list<\/code>\u3068\u3044\u3046\u540d\u524d\u306f\u81ea\u7531\u306b\u5909\u66f4\u3057\u3066OK\u3067\u3059\u3002<\/p>\n<h1>Laravel\u3067\u52d5\u7684\u306b\u4f7f\u3063\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u306e<code>datalist<\/code>\u3092<code>Laravel<\/code>\u306e\u4e2d\u3067\u52d5\u7684\uff08\u5909\u6570\u306e\u5185\u5bb9\u306b\u3088\u3063\u3066\u53ef\u5909\uff09\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u30b7\u30f3\u30d7\u30eb\u306a\u4f7f\u3044\u65b9<\/h2>\n<p>\u7d50\u5c40\u306e\u3068\u3053\u308d\u3001\u5148\u307b\u3069\u306e\u4f8b\u306e\u3088\u3046\u306b<code>&lt;option&gt;<\/code>\u3092\u7528\u610f\u3059\u308c\u3070\u30ea\u30b9\u30c8\u3068\u3057\u3066\u8a8d\u8b58\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30eb\u30fc\u30d7\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>&lt;input type=\"text\" list=\"todofuken_list\"&gt;\r\n&lt;datalist id=\"todofuken_list\"&gt;\r\n    <strong>@foreach(['\u6771\u4eac\u90fd', '\u5927\u962a\u5e9c', '\u4eac\u90fd\u5e9c', '\u798f\u5ca1\u770c', '\u5317\u6d77\u9053'] as $pref)<\/strong>\r\n<strong>        &lt;option value=\"{{ $pref }}\"&gt;<\/strong>\r\n<strong>    @endforeach<\/strong>\r\n&lt;\/datalist&gt;<\/pre>\n<p>\u203b \u5206\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306b\u90fd\u9053\u5e9c\u770c\u3092\u76f4\u306b\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5f8c\u3067\u7ba1\u7406\u3057\u3084\u3059\u3044\u306e\u3067\u306a\u3069\u306e\u5909\u6570\u306b\u5165\u308c\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5316\u3059\u308b<\/h2>\n<p>\u4eca\u56de\u306e\u4f8b\u306e\u3088\u3046\u306a\u90fd\u9053\u5e9c\u770c\u3092\u9078\u629e\u3059\u308b\u5834\u9762\u306f\uff11\u56de\u3060\u3051\u3067\u306a\u304f\u3001\u4f55\u5ea6\u3082\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u3044\u3064\u3067\u3082\u7c21\u5358\u306b\u3053\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u300c\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5316\u300d\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u672c\u4f53\u3068\u3057\u3066\u3001<\/p>\n<p><code>resources\/views\/components\/todofuken_list.blade.php<\/code><\/p>\n<p>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;!-- todofuken_list.blade.php --&gt;\r\n\r\n<strong>&lt;datalist id=\"todofuken_list\"&gt;<\/strong>\r\n<strong>    @foreach(['\u6771\u4eac\u90fd', '\u5927\u962a\u5e9c', '\u4eac\u90fd\u5e9c', '\u798f\u5ca1\u770c', '\u5317\u6d77\u9053'] as $pref)<\/strong>\r\n<strong>        &lt;option value=\"{{ $pref }}\"&gt;<\/strong>\r\n<strong>    @endforeach<\/strong>\r\n<strong>&lt;\/datalist&gt;<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u964d\u306f\u6b21\u306e\u3088\u3046\u306b\u305f\u3063\u305f\uff13\u884c\u3060\u3051\u3067\u30ea\u30b9\u30c8\u9078\u629e\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;input type=\"text\" list=\"todofuken_list\"&gt;\r\n<strong>@component('components.todofuken_list')<\/strong>\r\n<strong>@endcomponent<\/strong><\/pre>\n<p>\u3053\u308c\u3092\u5fdc\u7528\u3059\u308b\u3068\u8272\u3005\u306a\u30ea\u30b9\u30c8\u3092\u4f5c\u3063\u3066\u304a\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u958b\u767a\u304c\u3088\u308a\u7c21\u5358\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<h1>Vue\u3067\u52d5\u7684\u306b\u4f7f\u3063\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u7d9a\u3044\u3066\u306f<code>Vue<\/code>\u3067<code>datalist<\/code>\u3092\u4f7f\u3046\u4f8b\u3067\u3059\u3002<\/p>\n<h2>\u30b7\u30f3\u30d7\u30eb\u306a\u4f7f\u3044\u65b9<\/h2>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        &lt;input type=\"text\" list=\"todofuken_list\"&gt;\r\n        <strong>&lt;datalist id=\"todofuken_list\"&gt;<\/strong>\r\n<strong>            &lt;option v-for=\"pref in prefs\" :value=\"pref\"&gt;<\/strong>\r\n<strong>        &lt;\/datalist&gt;<\/strong>\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.0\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        <strong>new Vue({<\/strong>\r\n<strong>            el: '#app',<\/strong>\r\n<strong>            data: {<\/strong>\r\n<strong>                prefs: ['\u6771\u4eac\u90fd', '\u5927\u962a\u5e9c', '\u4eac\u90fd\u5e9c', '\u798f\u5ca1\u770c', '\u5317\u6d77\u9053']<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        });<\/strong>\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u5185\u5bb9\u7684\u306b\u306f\u5148\u307b\u3069\u3068\u540c\u3058\u304f<code>&lt;datalist&gt;&lt;\/datalist&gt;<\/code>\u5185\u306e<code>&lt;option&gt;<\/code>\u3092\u52d5\u7684\u306b\u4f5c\u6210\u3057\u3066\u3084\u308c\u3070\u3044\u3044\u3060\u3051\u306a\u306e\u3067\u3001<code>data<\/code>\u306b\u90fd\u9053\u5e9c\u770c\u30ea\u30b9\u30c8\u3092\u5165\u308c\u3066\u304a\u3044\u3066<code>v-for<\/code>\u30eb\u30fc\u30d7\u3067\u3072\u3068\u3064\u305a\u3064<code>option<\/code>\u3092\u4f5c\u3063\u3066\u3042\u3052\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<code>Vue<\/code>\u3067<code>datalist<\/code>\u3092\u4f7f\u3063\u305f\u5834\u5408\u306b\u4f55\u304c\u826f\u3044\u304b\u3068\u8a00\u3046\u3068\u3001<strong>\u300c\u5f8c\u304b\u3089\u30ea\u30b9\u30c8\u3092\u5909\u66f4\u3057\u3066\u3082OK\uff01\u300d<\/strong>\u3068\u3044\u3046\u70b9\u3067\u3059\u3002\u4eca\u56de\u306e\u3088\u3046\u306b<code>prefs<\/code>\u3068\u3044\u3046\u5909\u6570\u306b\u30ea\u30b9\u30c8\u3092\u5165\u308c\u3066\u304a\u3051\u3070\u3001<strong>\u5f8c\u304b\u3089\u305d\u306e\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u3082\u81ea\u52d5\u7684\u306b\u30ea\u30b9\u30c8\u5185\u5bb9\u304c\u5909\u66f4\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3064\u307e\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>mounted<\/code>\u5185\u3067\u30ea\u30b9\u30c8\u3092\u683c\u7d0d\u3057\u3066\u3082\u3044\u3044\u3067\u3059\u3057\u3001\u30af\u30ea\u30c3\u30af\u30a4\u30d9\u30f3\u30c8\u3067\u30ea\u30b9\u30c8\u5185\u5bb9\u3092\u5909\u66f4\u3057\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\ud83d\ude0a<\/p>\n<pre>&lt;div id=\"app\"&gt;\r\n    &lt;input type=\"text\" list=\"todofuken_list\"&gt;\r\n    &lt;datalist id=\"todofuken_list\"&gt;\r\n        &lt;option v-for=\"pref in prefs\" :value=\"pref\"&gt;\r\n    &lt;\/datalist&gt;\r\n    &lt;br&gt;\r\n    <strong>&lt;button type=\"button\" @click=\"changeList\"&gt;\u30ea\u30b9\u30c8\u3092\u5909\u66f4&lt;\/button&gt;<\/strong>\r\n&lt;\/div&gt;\r\n&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.0\"&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n\r\n    new Vue({\r\n        el: '#app',\r\n        data: {\r\n            prefs: []\r\n        },\r\n        methods: {\r\n            <strong>changeList() {<\/strong>\r\n\r\n                \/\/ \u30ea\u30b9\u30c8\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\r\n<strong>                this.prefs = ['\u5175\u5eab\u770c', '\u5948\u826f\u770c', '\u6ecb\u8cc0\u770c', '\u548c\u6b4c\u5c71\u770c', '\u4e09\u91cd\u770c'];<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n        },\r\n        mounted() {\r\n\r\n            <strong>this.prefs = ['\u6771\u4eac\u90fd', '\u5927\u962a\u5e9c', '\u4eac\u90fd\u5e9c', '\u798f\u5ca1\u770c', '\u5317\u6d77\u9053'];<\/strong>\r\n\r\n        }\r\n    });<\/pre>\n<h2>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5316\u3059\u308b<\/h2>\n<p>\u7d9a\u3044\u3066\u3001<code>Vue<\/code>\u3067\u3082\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u3057\u3066\u5f8c\u3067\u4f7f\u3044\u3084\u3059\u304f\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>\/\/ \u90fd\u9053\u5e9c\u770c\u30ea\u30b9\u30c8\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\r\nVue.component('todofuken_list', {<\/strong>\r\n<strong>    data() {<\/strong>\r\n<strong>        return {<\/strong>\r\n<strong>            prefs: ['\u6771\u4eac\u90fd', '\u5927\u962a\u5e9c', '\u4eac\u90fd\u5e9c', '\u798f\u5ca1\u770c', '\u5317\u6d77\u9053']<\/strong>\r\n<strong>        };<\/strong>\r\n<strong>    },<\/strong>\r\n<strong>    template: '&lt;datalist id=\"todofuken_list\"&gt;'+<\/strong>\r\n<strong>        '&lt;option v-for=\"pref in prefs\" :value=\"pref\"&gt;&lt;\/option&gt;'+<\/strong>\r\n<strong>        '&lt;\/datalist&gt;'<\/strong>\r\n<strong>});<\/strong>\r\n\r\nnew Vue({\r\n    el: '#app'\r\n});<\/pre>\n<p>\u203b <code>data<\/code>\u304c\u95a2\u6570\u306e\u8fd4\u308a\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5185\u3067\u306f\u3053\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3053\u306e\u3088\u3046\u306b\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>&lt;div id=\"app\"&gt;\r\n    <strong>&lt;input type=\"text\" list=\"todofuken_list\"&gt;<\/strong>\r\n<strong>    &lt;todofuken_list&gt;&lt;\/todofuken_list&gt;<\/strong>\r\n&lt;\/div&gt;<\/pre>\n<p>\u72ec\u81ea\u30bf\u30b0\u3092\u4f7f\u3048\u308b\u306e\u3067\u3088\u308a\u76f4\u611f\u7684\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h2>\u3082\u3063\u3068\u6c4e\u7528\u7684\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/h2>\n<p>\u4eca\u56de\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u90fd\u9053\u5e9c\u770c\u9650\u5b9a\u3067\u3057\u305f\u304c\u3001\u3082\u3057\u30c7\u30fc\u30bf\u306e\u4e2d\u8eab\u304c\u5909\u308f\u3063\u3066\u3082\u4f7f\u3048\u308b\u6c4e\u7528\u7684\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3082\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n\r\n    &lt;div id=\"app\"&gt;\r\n\r\n        &lt;!-- \u540d\u524d --&gt;\r\n<strong>        &lt;input type=\"text\" list=\"name\"&gt;<\/strong>\r\n<strong>        &lt;input-list id=\"name\" :options=\"names\"&gt;&lt;\/input-list&gt;<\/strong>\r\n\r\n        &lt;!-- \u90f5\u4fbf\u756a\u53f7 --&gt;\r\n<strong>        &lt;input type=\"text\" list=\"postal-code\"&gt;<\/strong>\r\n<strong>        &lt;input-list id=\"postal-code\" :options=\"postalCodes\"&gt;&lt;\/input-list&gt;<\/strong>\r\n\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.0\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        \/\/ \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u672c\u4f53\r\n<strong>        Vue.component('input-list', {<\/strong>\r\n<strong>            props: ['options'],<\/strong>\r\n<strong>            template: '&lt;datalist&gt;'+<\/strong>\r\n<strong>                '&lt;option v-for=\"option in options\" :value=\"option\"&gt;&lt;\/option&gt;'+<\/strong>\r\n<strong>                '&lt;\/datalist&gt;'<\/strong>\r\n<strong>        });<\/strong>\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                <strong>names: ['\u5c71\u7530\u592a\u90ce', '\u4f50\u85e4\u6b21\u90ce', '\u7530\u4e2d\u4e09\u90ce', '\u5c71\u672c\u56db\u90ce', '\u9234\u6728\u4e94\u6717'],<\/strong>\r\n<strong>                postalCodes: ['111-1111', '222-2222', '333-3333'],<\/strong>\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u5185\u5bb9\u3068\u3057\u3066\u306f\u3001<code>input-list<\/code>\u3068\u3044\u3046\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c<code>options<\/code>\u3068\u3044\u3046\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3001\u305d\u306e\u5185\u5bb9\u3092\u30eb\u30fc\u30d7\u3067\u8868\u793a\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u304c<strong>\u4f5c\u6210\u3057\u305f\u72ec\u81ea\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u76f4\u63a5 id \u3092\u6307\u5b9a\u3053\u3068\u304c\u3067\u304d\u308b<\/strong>\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/p>\n<pre>&lt;input type=\"text\" list=\"name\"&gt;\r\n&lt;input-list <strong>id=\"name\"<\/strong> :options=\"names\"&gt;&lt;\/input-list&gt;<\/pre>\n<p>\u5148\u307b\u3069\u306f\u90fd\u9053\u5e9c\u770c\u3067\u56fa\u5b9a\u3067\u3057\u305f\u306e\u3067<code>todofuken_list<\/code>\u3068\u3044\u3046<code>id<\/code>\u3092\u76f4\u63a5\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u672c\u4f53\u306b\u8a18\u8ff0\u3057\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f<code>&lt;input-list&gt;&lt;\/input-list&gt;<\/code>\u30bf\u30b0\u306b\u6307\u5b9a\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001Vue\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306fHTML\u30bf\u30b0\u3068\u540c\u3058\u3088\u3046\u306b\u3064\u304b\u3048\u308b\u306e\u3067\u3001\u3088\u308a\u6c4e\u7528\u7684\u306b\u4f7f\u3048\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u3044\u3064\u3082\u3068\u9055\u3063\u3066\u6839\u672c\u7684\u306a<code>HTML 5<\/code>\u306e\u5185\u5bb9\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><code>&lt;datalist&gt;&lt;\/datalist&gt;<\/code>\u306f\u3053\u308c\u307e\u3067\u3042\u307e\u308a\u4f7f\u3063\u3066\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001IE 11\u3067\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u4eca\u5f8c\u306f\u30c9\u30b7\u30c9\u30b7\u4f7f\u3063\u3066\u3044\u3053\u3046\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u3053\u308c\u307e\u3067\u306f<code>select2<\/code>\u3092\u4f7f\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u9055\u3044\u304c\u3042\u3063\u305f\u308a<code>Bootstrap<\/code>\u306e\u30e2\u30fc\u30c0\u30eb\u5185\u3067\u306f\u52d5\u304b\u306a\u304b\u3063\u305f\u308a\u3068\u3044\u308d\u3044\u308d\u3068\u624b\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u305f\u306e\u3082\u4e8b\u5b9f\u306a\u306e\u3067\u4eca\u5f8c\u306f\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u306b\u3059\u308b\u305f\u3081\u306b<code>&lt;datalist&gt;&lt;\/datalist&gt;<\/code>\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3082\u8003\u3048\u3066\u3044\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u304b\u306a\u3001\u3068\u3082\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u66f4\u306a\u304c\u3089\u3067\u3059\u304c\u4ed6\u306e<code>HTML 5<\/code>\u3082\u3061\u3087\u3063\u3068\u305a\u3064\u8a66\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u6311\u6226\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-25 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15.png\" alt=\"\" width=\"348\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15.png 348w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15-300x276.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2017\/06\/15-30x28.png 30w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u3053\u306e\u3068\u3053\u308dVue\u306e\u8a18\u4e8b\u3092\u9023\u7d9a\u3057\u3066\u6295\u7a3f\u3057\u3066\u304d\u305f\u306e\u3067\u4eca\u56de\u306f\u5c11\u3057\u6c17\u5206\u3092\u5909\u3048\u3066\u3001\u3082\u3063\u3068\u6839\u672c\u7684\u306a\u5185\u5bb9\u3092\u304a\u5c4a\u3051\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u5177\u4f53\u7684\u306b\u306f\u300cHTML 5\u300d\u3067\u3059 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=4783\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Vue\uff06Laravel\u3011\u5165\u529b or \u9078\u629e\u3067\u304d\u308b\u300cdatalist\u300d\u3092\u4f7f\u3046\u30b5\u30f3\u30d7\u30eb&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":4790,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27,3,12],"tags":[],"class_list":["post-4783","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5","category-laravel","category-vue-js"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4783","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=4783"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4783\/revisions"}],"predecessor-version":[{"id":7147,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4783\/revisions\/7147"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/4790"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}