承接 everzel/nova-charcounted-fields 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

everzel/nova-charcounted-fields

Composer 安装命令:

composer require everzel/nova-charcounted-fields

包简介

Text and textarea fields with a character counter.

README 文档

README

Text and textarea fields with a character counter for Laravel Nova.

Installation

Add the GitHub URL to your repositories list in composer.json:

"repositories": [
  {
    "type": "vcs",
    "url": "git@github.com:optimistdigital/nova-charcounted-fields.git"
  }
]

You can require this package using composer:

composer require everzel/nova-charcounted-fields

Usage

You can add the field with a resolver as follows:

use Everzel\CharcountedFields\TextCounted;
use Everzel\CharcountedFields\TextareaCounted;

TextCounted::make('Meta title')

Image of character counter

You can use the text and textarea fields with charactercounters on you Nova model. The max number of characters aren't enforced, but just encouraged with warning colors and the counter. (You could enforce the max number of characters with Nova's built in rules and with a maxlength extra attribute).

TextCounted::make('Meta title')
    ->maxChars(60)
    ->warningAt(50)
    ->withMeta(['extraAttributes' => ['maxlength' => '65']]),

TextareaCounted::make('Meta description')
    ->maxChars(160)
    ->warningAt(150)
    ->rows(3),

The maxChars and warningAt are both optional. The color of the counter will change when the max or warningAt limit is reached. Image of character counter with indication

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 10
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-11