该软件包最新版本(v2.2.2)没有提供许可证信息。

live-controls 的输入掩码库

安装: 524

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 0

开放问题: 3

语言:Blade

v2.2.2 2024-05-13 20:52 UTC

This package is auto-updated.

Last update: 2024-09-13 21:37:53 UTC


README

发布版本 Packagist 版本 live-controls 输入掩码库

要求

  • Laravel 9+
  • Livewire 2+

翻译

  • 英语(en)
  • 德语(de)
  • 巴西葡萄牙语(pt_BR)

安装

  1. 安装 Masks 包
composer require live-controls/masks

CDN 安装

  1. 在 /head 标签之前包含 @livecontrolsMasks()
  2. 如果没有发布配置文件,将 local_files 设置为 false(这是默认选项)

本地安装

  1. 运行
npm install imask
  1. 添加到 app.js
import IMask from 'imask';
  1. 运行
npm run build;
  1. 运行
php artisan vendor:publish --tag="livecontrols.masks.config";
  1. 编辑 config/livecontrols-masks.php
'local_files' => true, //Set local_files to true

用法

@livewire('livecontrols-currencymask', [
'maskId' => 'someUniqueId',
'maskName' => 'someUniqueName',
'unmaskedId' => 'idforhiddeninput',
'unmaskedName' => 'nameforhiddeninput',
'class' => 'input input-bordered w-full',
'required' => true,
'value' => 'set to something if you want to use it for update',
'currencyString' => 'R$',
'updateCallName' => 'WillBeFiredIfValueGotUpdated'
], key())

要更新一个值,请调用

$this->dispatch('update-mask-value-maskId', value: 500);