zoukankan      html  css  js  c++  java
  • vue-tags-input

    文档链接:http://www.vue-tags-input.com/#/examples/autocomplete

     需求: 输入英文状态逗号、分号、空格、回车进行分隔,也可联想输入

    npm install @johmun/vue-tags-input
    import VueTagsInput from '@johmun/vue-tags-input';
    <vue-tags-input :preventAddingDuplicates="false" v-model="tag" :tags="tags" :autocomplete-items="autocompleteItems" :add-on-key="[';', ',', ' ', 13]" @tags-changed="newTags => tags = newTags" />
            
    add-on-key: 按下其中之一,则会从输入值中生成一个标签,可以接受keycode值(回车:13)
    autocompleteItems: 联想的数据
    data() {
                return {
                    tag:'',
                    tags: [],
                    autocompleteItems: [
                        {text: '张三'},
                        {text: '李四'},
                        {text: '王五'},
                        {text: '麻子'},
                        {text: '小二'},
                        {text: '王八'},
                    ]
                };
            },





  • 相关阅读:
    JS高级程序设计 第三章笔记
    JS高级程序设计第二章
    JS高级程序设计 第一章读书笔记
    markdown 尝试
    实验九
    第六章总结
    实验五
    第五章总结
    实验四
    实验三
  • 原文地址:https://www.cnblogs.com/xhrr/p/14156226.html
Copyright © 2011-2022 走看看