php laravel mix,Laravel框架 之 Mix

本文的示例代码参考mix-basic

目录

Composer

composer create-project laravel/laravel mix-basic --prefer-dist "5.5.*"

cd mix-basic

Auth

docker run --name laravel-mix -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7.17

docker exec -i laravel-mix mysql -uroot -p123456 <<< "CREATE DATABASE IF NOT EXISTS basic DEFAULT CHARSET utf8 COLLATE utf8_general_ci;"

sed -i "" 's/DB_DATABASE=homestead/DB_DATABASE=basic/g' .env

sed -i "" 's/DB_USERNAME=homestead/DB_USERNAME=root/g' .env

sed -i "" 's/DB_PASSWORD=secret/DB_PASSWORD=123456/g' .env

php artisan make:auth

php artisan migrate

测试

php artisan serve

Name: test1

Email: test1@zeaho.com

Password: test1zeaho

Mix

cnpm i

Versioning

vim webpack.mix.js

let mix = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')

.sass('resources/assets/sass/app.scss', 'public/css')

.version();

sed -i "" 's/asset/mix/g' resources/views/layouts/app.blade.php

cnpm run prod

Source Maps

vim webpack.mix.js

let mix = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')

.sourceMaps()

.sass('resources/assets/sass/app.scss', 'public/css')

.version();

cnpm run watch-poll

Vendor Extraction

vim webpack.mix.js

let mix = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')

.extract(['axios', 'bootstrap-sass', 'jquery', 'lodash', 'vue'])

.sourceMaps()

.sass('resources/assets/sass/app.scss', 'public/css')

.version();

JS & CSS

vim resources/assets/js/register.js

console.log('register');

vim resources/assets/sass/register.scss

.panel-heading {

color: red !important;

}

vim resources/views/layouts/app.blade.php

@yield('css')

@yield('script')

vim resources/views/auth/register.blade.php

@section('css')

@endsection

@section('script')

@endsection

EasyUI

下载并导入 EasyUI

mkdir public/vendor

cp -R jquery-easyui-1.6.3 public/vendor/

find public/vendor/jquery-easyui-1.6.3 -type d

public/vendor/jquery-easyui-1.6.3

public/vendor/jquery-easyui-1.6.3/themes

public/vendor/jquery-easyui-1.6.3/themes/default

public/vendor/jquery-easyui-1.6.3/themes/default/images

public/vendor/jquery-easyui-1.6.3/themes/icons

vim resources/views/layouts/app.blade.php

@yield('css')

@yield('script')

vim resources/views/home.blade.php

@extends('layouts.app')

@section('content')

Dashboard

@if (session('status'))

{{ session('status') }}

@endif

You are logged in!

jQuery EasyUI framework helps you build your web pages easily.

  • easyui is a collection of user-interface plugin based on jQuery.
  • easyui provides essential functionality for building modem, interactive, javascript applications.
  • using easyui you don't need to write many javascript code, you usually defines user-interface by writing some HTML markup.
  • complete framework for HTML5 web page.
  • easyui save your time and scales while developing your products.
  • easyui is very easy but powerful.

This is the help content.

data-options="singleSelect:true,collapsible:true,url:'datagrid_data1.json',method:'get'">

Item IDProductList PriceUnit CostAttributeStatus

@endsection

关于EasyUI更多介绍 可以参考JQuery EasyUI中文网

参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值