ferdinandfrank/vue-forms
Composer 安装命令:
composer require ferdinandfrank/vue-forms
包简介
A collection of vue.js form and input components to create pretty ajax requests.
README 文档
README
Warning: This package is not maintained anymore!
This package provides a collection of Vue.js form and input components to create pretty and easy ajax requests on a Laravel application.
Full documentation: https://ferdinandfrank.github.io/vue-forms/
Example
HTML form with two input components which get cleared after the submit. Additionally a success alert message will be shown after the server processed the request.
In your HTML / Blade file:
<ajax-form method="[METHOD]" action="[ACTION]" :clear="true"> <form-input name="name" label="Name" :value="MyName"></form-input> <form-select name="gender" label="Gender" :value="m"> <option value="m">Male</option> <option value="f">Female</option> </form-select> <button type="submit">Submit</button> </ajax-form>
In your controller method:
public function handleRequest(Request $request) { // Handle the request return response()->json([ 'alert' => [ 'title' => 'Success', 'message' => 'Request was successful!', 'accept' => 'Alright!' ] ]); }
Requirements
Server Requirements
- PHP >= 7.0
- An existing >= Laravel 5.4 project
JS Requirements
There are a few requirements of your Laravel application for the package to work properly on the client side.
You can install them by just including the according entries in your package.json file (see Installation #4).
Mandatory
- Vue.js >= 2.1.10: To render the Vue.js components.
- Lodash >= 4.17.4: For using JS helper functions in the scripts which makes the code cleaner
- MomentJS >= 2.18.1: For date formatting on JS
- JQuery >= 3.1.1: For element selection and ajax requests
Optional
- Bootstrap >= 3.3.7: For the design of the input components
- Sweetalert >= 2.0.4: To show pretty alert / confirm messages
- Tooltip.js >= 1.1.5: To show help texts on the inputs as a pretty tooltip
Optional Requirements
To show a loading icon when a form gets submitted as well as to show a help icon next to the inputs, Font Awesome will be used. Font Awesome need to be installed properly on the application to show these icons. Otherwise the components need to be configured.
The HTML content of the components is designed for the usage with Bootstrap 4. To have a nice design of the inputs out of the box, Bootstrap is required.
Installation
-
To get started, install the package via the Composer package manager:
composer require ferdinandfrank/vue-forms
-
In Laravel >= 5.5 this package registers automatically. For previous Laravel versions add the following entry to your providers array in
config/app.php:'providers' => [ ... ... \FerdinandFrank\VueForms\Providers\VueFormsServiceProvider::class ]
-
Publish the Vue.js components and other scripts to the
resources/assets/vendor/vue-formsfolder, so you can edit and include the package's files within you application's scripts:php artisan vue-forms:init
-
Add the following entries to the
dependenciesarray in yourpackage.jsonfile, if these do not yet exist. The first four are required, the last four (sweetalert, bootstrap-sass, popper.js, tooltip.js) optional (see Optional Requirements)."dependencies": { "vue": "^2.1.10", "lodash": "^4.17.4", "jquery": "^3.1.1", "moment": "^2.18.1", "sweetalert": "^2.0.4", "bootstrap-sass": "^3.3.7", "popper.js": "^1.12.5", "tooltip.js": "^1.1.5" }
-
Include the main JS within your application's script, e.g., from
resources/assets/js/app.jscopy the following statement:require('../vendor/vue-forms/js/vue-forms');
-
Include the main SCSS within your application's script, e.g., from
resources/assets/sass/app.scsscopy the following statement:@import "../vendor/vue-forms/scss/vue-forms";
-
Compile your scripts via webpack or any other compiler.
That's it! You can now use the Vue.js components of this package.
Documentation
Click here for the full documentation
License
ferdinandfrank/vue-forms 适用场景与选型建议
ferdinandfrank/vue-forms 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 103 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 11 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「bootstrap」 「ajax」 「language」 「Forms」 「requests」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ferdinandfrank/vue-forms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ferdinandfrank/vue-forms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ferdinandfrank/vue-forms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Easy to use i18n translation PHP class for multi-language websites
Package for convenient work with Laravel's localization features
Store your language lines in the database, yaml or other sources
Set Links with a specific language parameter
Selenium4 (WebDriver) driver for Mink framework
统计信息
- 总下载量: 103
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-18