superlatif/nova-tag-input 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

superlatif/nova-tag-input

最新稳定版本:5.0

Composer 安装命令:

composer require superlatif/nova-tag-input

包简介

Tag input field for Laravel Nova.

README 文档

README

This plugin incorporate the Vue Tags Input plugin by Johannes Munari into Laravel Nova by creating a new field type.

Nova Tag Input

Nova 4

This release must be used with Nova version 4 and above. Thanks to @dmason30 for the PR. To install a Nova 3 compatible version please see at the end.

Installing

Using Composer:

composer require superlatif/nova-tag-input

Example

Basic

Tags::make(__("Tags"), 'tags')
    ->help("Press ENTER to add tag")
    ->placeholder("Add a new tag")
    ->allowEditTags(true)
    ->addOnKeys([13, ':', ';', ',']) // 13 = Enter key
    ->autocompleteItems([
        'Arizona',
        'California',
        'Colorado',
        'Michigan',
        'New York',
        'Texas',
    ]),

Autocomplete items from Eloquent

$tags = Tag::pluck('title')->get();
Tags::make(__("Tags"), 'tags')
    // ...
    ->autocompleteItems($tags)
    // ...

Parameters

Parameter Description Type Default
autocompleteItems Array of strings used for autocompletion Array -
addOnKeys Set of characters triggering tag insertion Array [13]
separators Defines characters which split text into tags (useful when copy-pasting) Array [';']
placeholder Hint displayed when the field is empty or after a list of existing tags String -
addFromPaste Tags can be created from pasted text Boolean true
addOnBlur Tag is created when field loses focus Boolean true
addOnlyFromAutocomplete Only allow tag creation from the autocompleteItems array Boolean false
allowEditTags Allow inline tag edition Boolean false
autocompleteAlwaysOpen Autocomplete list remains open Boolean false
autocompleteFilterDuplicates Removes duplicates from autocomplete list Boolean true
autocompleteMinLength The minimum text that must be entered before autocomplete Boolean 1
avoidAddingDuplicates Prevent duplicated tags Boolean true
deleteOnBackspace Delete tags using backspace Boolean true
disabled Disable the field Boolean false
maxTags Max number of tags Boolean -

Installing

To use a Nova 3 compatible version please use the following command:

composer require superlatif/nova-tag-input:3.0

Support us!

If you think we saved you some time on your development, please consider showing your appreciation 😁

Buy Me A Coffee

统计信息

  • 总下载量: 256.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 0
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 17
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-25