在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):laravel/ui开源软件地址(OpenSource Url):https://github.com/laravel/ui开源编程语言(OpenSource Language):PHP 93.6%开源软件介绍(OpenSource Introduction):Laravel UIIntroductionWhile Laravel does not dictate which JavaScript or CSS pre-processors you use, it does provide a basic starting point using Bootstrap, React, and / or Vue that will be helpful for many applications. By default, Laravel uses NPM to install both of these frontend packages.
Official DocumentationSupported VersionsOnly the latest major version of Laravel UI receives bug fixes. The table below lists compatible Laravel versions:
InstallationThe Bootstrap and Vue scaffolding provided by Laravel is located in the composer require laravel/ui Once the // Generate basic scaffolding...
php artisan ui bootstrap
php artisan ui vue
php artisan ui react
// Generate login / registration scaffolding...
php artisan ui bootstrap --auth
php artisan ui vue --auth
php artisan ui react --auth CSSLaravel Mix provides a clean, expressive API over compiling SASS or Less, which are extensions of plain CSS that add variables, mixins, and other powerful features that make working with CSS much more enjoyable. In this document, we will briefly discuss CSS compilation in general; however, you should consult the full Laravel Mix documentation for more information on compiling SASS or Less. JavaScriptLaravel does not require you to use a specific JavaScript framework or library to build your applications. In fact, you don't have to use JavaScript at all. However, Laravel does include some basic scaffolding to make it easier to get started writing modern JavaScript using the Vue library. Vue provides an expressive API for building robust JavaScript applications using components. As with CSS, we may use Laravel Mix to easily compile JavaScript components into a single, browser-ready JavaScript file. Writing CSSAfter installing the Before compiling your CSS, install your project's frontend dependencies using the Node package manager (NPM): npm install Once the dependencies have been installed using npm run dev The Writing JavaScriptAll of the JavaScript dependencies required by your application can be found in the npm install
Once the packages are installed, you can use the npm run dev By default, the Laravel
Writing Vue ComponentsWhen using the Vue.component(
'example-component',
require('./components/ExampleComponent.vue').default
); To use the component in your application, you may drop it into one of your HTML templates. For example, after running the @extends('layouts.app')
@section('content')
<example-component></example-component>
@endsection
If you are interested in learning more about writing Vue components, you should read the Vue documentation, which provides a thorough, easy-to-read overview of the entire Vue framework. Using ReactIf you prefer to use React to build your JavaScript application, Laravel makes it a cinch to swap the Vue scaffolding with React scaffolding: composer require laravel/ui
// Generate basic scaffolding...
php artisan ui react
// Generate login / registration scaffolding...
php artisan ui react --auth Adding PresetsPresets are "macroable", which allows you to add additional methods to the use Laravel\Ui\UiCommand;
UiCommand::macro('nextjs', function (UiCommand $command) {
// Scaffold your frontend...
}); Then, you may call the new preset via the php artisan ui nextjs ContributingThank you for considering contributing to UI! The contribution guide can be found in the Laravel documentation. Code of ConductIn order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct. Security VulnerabilitiesPlease review our security policy on how to report security vulnerabilities. LicenseLaravel UI is open-sourced software licensed under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论