原创 vue中使用cookie存儲數據
setCookie: function (cname, cvalue, exdays) { let d = new Date() d.setTime(d.getTime() + (exdays * 24 * 60 * 60 *
原创 element-ui 下拉選框直接獲取整個option上綁定的數據
<el-select v-model="value_item" placeholder="請選擇項目" @change="handlerSearch($event, 2)"> <el-option v-for="item
原创 用Laravel-Mix爲Vue按需加載的文件添加版本號
const mix = require('laravel-mix'); /* |--------------------------------------------------------------------------
原创 element+vue 自定義播放器組件
只控制能不能重複播放和拖拽進度,2個參數theUrl和type <template> <div class="di main-wrap" v-loading="audio.waiting"> <!-- 這裏設置了ref屬性
原创 Vue中的:class的使用
一個樣式 :class="{makeColor:username!=''}" 多個樣式(三元) :class="[email!=''?'makeColor':'',result.email===false?'makeColorRed'
原创 laravel-excel進行導入
前端 <input id="fileSelect" name="fileSelect" ref="inputer" type="file"/> <button class="btn btn-danger" style="margin-
原创 laravel中使用laravel-excel進行導出
composer require "maatwebsite/excel:~2.1.0" 在config/app.php中註冊服務提供者到providers數組 Maatwebsite\Excel\ExcelServiceProvide
原创 PHP數組計數
array_count_values($arr)
原创 mysql查詢字段中存在某個值
select 字段名from 表名where locate('1',字段名) select 字段名 from 表名where 字段名like '%1%' select 字段名 from 表名where find_in_set('1
原创 laravel存在條件的時候爲orm加入條件判斷
isset($method) && !empty($method) && $orm->where('test_method', $method);
原创 laravel計數統計
$data = $res->with('book') ->withCount(['records as all','records as correct' => function ($query) { $query->w
原创 laravel獲取固定條數數據
->take(30)
原创 chart.js在堆積柱形圖上面加上彙總的線形圖
<!doctype html> <html> <head> <title>Stacked Bar Chart</title> <script src="https://cdnjs.cloudflare.com/ajax/l
原创 laravel orm隨機排序
->inRandomOrder()
原创 日期及時間處理包 Carbon 在 Laravel 中的簡單使用
在編寫 PHP 應用時經常需要處理日期和時間,這篇文章帶你瞭解一下 Carbon – 繼承自 PHP DateTime 類的 API 擴展,它使得處理日期和時間更加簡單。Laravel 中默認使用的時間處理類就是 Carbon。 1 安裝