linuxstreet/wire-content-modal 问题修复 & 功能扩展

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

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

linuxstreet/wire-content-modal

最新稳定版本:v2.0.0

Composer 安装命令:

composer require linuxstreet/wire-content-modal

包简介

Flexible way of loading Livewire component or Blade view inside a modal.

README 文档

README

Latest Stable Version License Total Downloads

Installation

Requires:

Via Composer:

composer require linuxstreet/wire-content-modal

Modify your tailwind.config.js file, so it includes this package when building assets.

export default {
    content: [
        ...
        './vendor/linuxstreet/wire-content-modal/resources/views/**/*.blade.php',
    ],

Usage

In web development, often we need to overlay a smaller window, or modal, on top of the main page to display additional information or allow user interaction. This modal can be populated with content from different sources, such as a Livewire component or a Blade view.

Place component on the web page

<livewire:content-modal/>

Modal is listening for 'modal-show' and 'modal-hide' browser events.

AlpineJS @click example:

<button x-data @click.throttle="$dispatch('modal-show', [=PARAMS])">Show</button>

Params:

Mandatory:

  • component: [string] - Name of the Livewire component to be loaded
  • OR
  • view: [string] - Name of the Blade view to be loaded

NOTE: If neither component or view is provided, Exception will be thrown.

Optional:

  • spinnerClass: [string] - Pass additional CSS classes to the loading spinner (default: '')
  • params: [array] - Pass additional params to Component/View (default: [])

Examples:

Provide either 'component' or 'view' options like this:

{ component: 'livewire_component' }
or
{ view: 'blade_view' }

Examples with HTML button element using AlpineJS:

<button x-data @click.throttle="$dispatch('modal-show', [{ component: 'my-component' }] )">Show</button>
<button x-data @click.throttle="$dispatch('modal-show', [{ view: 'my-view' }] )">Show</button>

Change log

Please see the changelog for more information on what has changed recently.

Layout Customisation

This package uses TailwindCSS classes. If you want to customize the layout for different CSS framework use:

php artisan vendor:publish --provider="Linuxstreet\WireContentModal\WireContentModalServiceProvider"

Testing

./vendor/bin/pest

Contributing

Please see contributing.md for details.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

  • Igor Jovanovic

License

Please see the license file for more information.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固