定制 mattsplat/readmore 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mattsplat/readmore

最新稳定版本:1.0.3

Composer 安装命令:

composer require mattsplat/readmore

包简介

A Laravel Nova field to hide long text and show when clicked.

README 文档

README

For the index view adds the ability to shorten text/textarea or show all by clicking on the field.

Works by adding a macro to Laravel Nova Text which is extended by TextArea so it works for both.

Install

composer require mattsplat/readmore

Usage with TextArea

Textarea::make('Notes')
    ->showOnIndex()
    ->readMore(),
                

with options


Textarea::make('Notes')
    ->showOnIndex()
    ->readMore(['mask' => 'Look Here', 'max' => 5]),

or using Text


Text::make('Notes')->readMore(),

Options

  • max - number of characters to display (default 20)
  • mask - text displayed to show all text (default ...)

Use an icon instead of text

$icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path class="heroicon-ui" d="M6 2h9a1 1 0 0 1 .7.3l4 4a1 1 0 0 1 .3.7v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.1.9-2 2-2zm9 2.41V7h2.59L15 4.41zM18 9h-3a2 2 0 0 1-2-2V4H6v16h12V9zm-5 4h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2v-2a1 1 0 0 1 2 0v2z"/></svg>';

Text::make('Notes')->readMore(['max' => 0, 'mask' => $icon]),

Inspired by

Index TextArea by Brian Dillingham

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-06