LoginSignup
1
0

More than 3 years have passed since last update.

タグフォーム「Voerro Vue Tags Input v2」にタグ追加ボタンをつけた

Last updated at Posted at 2020-06-24

簡単にタグフォームを設置できる「Voerro Vue Tags Input v2」、
ボタンをクリックでもタグの追加 が出来るようにしました。

前提:用意されたタグ追加タイミングはキー入力のみ

「Voerro Vue Tags Input v2」で用意されているタグの追加タイミングは以下
1. Enterキー押下
2. カンマ(,)入力

https://github.com/voerro/vue-tagsinput/blob/master/dist/voerro-vue-tagsinput.js
https://github.com/voerro/vue-tagsinput/blob/master/src/VoerroTagsInput.vue

方法:タグ追加時に実行される関数を使用

タグ追加時に実行される関数
tagFromInput(); を使用します。

<input type="button" name="" value="追加" @click="addTag"></button>
addTag: function() {
    // voerro-vue-tagsinput.jsでタグ追加時に実行される関数
    this.$refs.tagsInput.tagFromInput();
},

その他「Voerro Vue Tags Input v2」組み込みに参考にしたリンク

組み込み方
https://www.kabanoki.net/5059/

機能カスタマイズ
https://voerro.github.io/vue-tagsinput/

cssのカスタマイズ
http://translate.google.co.jp/translate?hl=ja&sl=auto&tl=ja&u=https%3A%2F%2Fgithub.com%2Fvoerro%2Fvue-tagsinput

リポジトリ
https://github.com/voerro/vue-tagsinput?ref=kabanoki.net

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0