- 博客(50)
- 收藏
- 关注
原创 vuex的用法详解,含模块化及辅助函数(mapState, mapMutations, mapActions, mapGetters)
【代码】vuex的用法详解,含模块化及辅助函数(mapState, mapMutations, mapActions, mapGetters)
2023-04-04 15:22:03
416
原创 el-table 去掉最下面的白线
.parent .el-table::before{ background-color: transparent; }
2022-05-31 16:36:10
1296
原创 vue-cli开启https
vueconst internalIp = require('internal-ip'); // 获取当前IP地址module.exports = { devServer: { https: true, port: 9999, host: internalIp.v4.sync(), }};
2022-05-20 15:35:51
1453
原创 Leaflet获取瓦片并转为图片的base64地址
axios.get(`${url}/wmsmap/getmap`, { params: { dsid, uid, request: 'GetMap', service: 'WMS', width: 256, height: 256, format: 'image/png', transparant: true, version: '1.1.1', .
2022-04-01 10:52:04
457
原创 url中的query切割
const q = {};location.search.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v);console.log(q);
2022-01-17 16:59:10
227
原创 css调整placeholder
::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #fff !important;}:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #fff !important; opacity: 1;}::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #fff !important; .
2021-10-09 11:34:57
677
原创 content-visibility: 一个可以提高渲染性能的css属性
.div{ content-visibility: auto; contain-intrinsic-size: 100px;}
2021-08-10 14:31:34
271
原创 获取用户浏览器环境及版本
const inBrowser = typeof window !== "undefined";const UA = inBrowser && window.navigator.userAgent.toLowerCase();export const isIE = UA && /msie|trident/.test(UA);export const isIE9 = UA && UA.indexOf("msie 9.0") > 0;export .
2021-07-09 11:31:00
279
原创 js复制到剪贴板
const copyText = (text=copyTextTemp) => { var save = function (e) { e.clipboardData.setData('text/plain',text); e.preventDefault(); } document.addEventListener('copy',save); document.execCommand('copy'); document.rem.
2021-07-08 15:27:18
184
原创 vscode国内快速下载
http://vscode.cdn.azure.cn/stable/507ce72a4466fbb27b715c3722558bb15afa9f48/VSCodeUserSetup-x64-1.57.1.exe
2021-07-02 10:05:00
1142
原创 vuex用法
一、使用Vuex的目的实现多组件状态管理,多个组件之间需要数据共享二、Vuex 的五大核心其中state和mutation是必须的,其他可根据需求来加 1、state 负责状态管理,类似于vue中的data,用于初始化数据 2、mutation 专用于修改state中的数据,通过commit触发 3、action 可以处理异步,通过dispatch触发,不能直接修改state,首先在组件中通过dispatch触发action,然后在action函数内部commit触
2021-06-17 11:28:23
367
转载 站在 CSS 大佬的肩上画图形(合集)
1、边框内圆角有时我们需要一个容器,只在内侧有圆角,而边框或描边的四个角在外部仍然保持直角的形状,最普遍就是用两个元素来实现这个效果,现在介绍一下用一个元素来实现。//HTML<divclass="elemt"></div>//CSS.elemt{width:150px;height:150px;box-shadow:00012px#655;background:tan;outline:6pxsolid#...
2021-06-17 10:36:40
208
原创 前端实用函数封装
1. 随机获取布尔值const getRandomBoolean = () => Math.random() >= 0.5;console.log(getRandomBoolean());// a 50/50 chance of returning true or false2. 检查日期是否为周末const isWeekend = (date) => [0, 6].indexOf(date.getDay()) !== -1;console.log(isWeekend(n.
2021-06-17 10:22:47
352
原创 js封装深拷贝clone函数,可处理Symbol、自定义Class等所有数据类型
function clone(data){ if(typeof data==='symbol'){ //Symbol return Symbol.for(data.description); }else if(typeof data!='object'){ //基本类型 return data; }else if(data instanceof Array){ //Array return data.map(item=>cl.
2021-05-24 15:45:14
721
原创 波纹进度条
<!doctype html><html lang="en"><head> <meta charset="UTF-8" /> <title>Document</title> <style type="text/css"> #c{ margin: 0 auto; display: block; } #r{ display: block; margin: 0 auto; } .
2021-05-12 15:17:29
173
原创 GitHub通过修改host加速
140.82.114.3 github.com185.199.108.153 assets-cdn.github.com185.199.109.153 assets-cdn.github.com185.199.110.153 assets-cdn.github.com185.199.111.153 assets-cdn.github.com199.232.5.194 github.global.ssl.fastly.net140.82.114.4 gist.github.com199.232.
2021-03-17 11:33:33
3541
原创 application.properties中的配置
# 数据库访问配置# 主数据源,默认的spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driverClassName = com.mysql.jdbc.Driverspring.datasource.url = jdbc:mysql://localhost:3306/flagspring.datasource.username = rootspring.datasource.pas.
2021-02-23 17:18:45
1616
原创 element-UI中el-select组件使用拼音进行模糊匹配可选择项
一、安装pinyin-match包yarn add pinyin-match二、引入包import PinYinMatch from 'pinyin-match';三、直接上代码<el-select v-model="value" multiple filterable clearable :filter-method="match"> <el-option v-for="item in optionList" :key="item.value" :lab
2021-01-20 15:49:09
990
原创 docker如何离线安装到centos
下载地址rpmhttps://download.docker.com/linux/centos/7/x86_64/stable/Packages/安装上传文件,解压[root@a opt]#tar -xvf docker-18.06.3-ce.tgz复制[root@a opt]cp docker/* /usr/bin/启动服务[root@a opt]dockerd &测试[root@centos75-1 ~]#docker -vDocker versio...
2020-09-17 17:00:53
167
原创 前端vue Excel表格导入导出功能(纯前端)
目录第一步、安装插件第二步、导入Blob.js和Export2Excel.js,在/src/assets下新建文件第三步、导入文件第四步、导出文件第一步、安装插件yarn add file-saver xlsx script-loader第二步、导入Blob.js和Export2Excel.js,在assets下新建文件1. Blob.js/* eslint...
2020-01-17 17:04:44
2440
原创 基于canvas的Node.js视频抽帧存图服务
前端代码:if(this.getFileType(file.type) == "video"){ let windowURL = window.URL || window.webkitURL; let videoURL = windowURL.createObjectURL(file); let player = document.createElement("video"); pl...
2019-11-20 16:44:48
1343
原创 查询几天内的数据
查询今日数量:select count(1) from task where TO_DAYS(create_time) = TO_DAYS(NOW())查询近七天数量:select count(1) from task where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(create_time)查询近一个月数量:SELECT c...
2019-11-05 09:43:46
509
原创 js将秒转为时分秒
getFormatDuration(second){ let result = parseInt(second); let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600); let m = Math.floor((result / 60 %...
2019-10-24 15:01:35
527
原创 使elementUI的dialog上下左右居中
.el-dialog{ display: flex; flex-direction: column; margin:0 !important; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); /*height:600px;*/ max-height:calc(100% ...
2019-09-27 14:41:03
21473
15
原创 CSS使文本不能被选中
body{ -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;}
2019-09-25 15:14:53
1502
原创 样式变化动画
-webkit-transition: all .3s; -moz-transition: all .3s; -ms-transition: all .3s; -o-transition: all .3s; transition: all .3s;
2019-09-11 18:00:32
196
原创 css透明格子图片背景
background-image: linear-gradient(45deg, rgb(238, 238, 238) 25%, transparent 25%, transparent 75%, rgb(238, 238, 238) 75%, rgb(238, 238, 238)), linear-gradient(45deg, rgb(238, 238, 238) 26%, rgb(255,...
2019-09-05 17:36:01
1303
原创 原生JS+KOA大型文件(G级)切片上传
前端代码:(执行文件切片循环上传并最后发起结束合并请求)async ApiUploadBigFile(file){ let bytesPerPiece = 1*1024*1024;//切片大小 let start = 0; let end; let index = 0; let file_size = file.size; let file_name = file.name; ...
2019-09-03 14:08:34
985
原创 css优化滚动条样式
::-webkit-scrollbar-track-piece { -webkit-border-radius: 0}::-webkit-scrollbar { width: 5px; height: 10px}::-webkit-scrollbar-thumb { height: 50px; background-color: #b8b8b8; -webkit-...
2019-08-07 14:59:22
3004
原创 判断当前系统为安卓还是ios
var u = navigator.userAgent, app = navigator.appVersion;var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //gvar isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终...
2019-04-03 18:51:15
3066
原创 css的单行超出部分...和多行超出部分...
单行: .box{ text-overflow:ellipsis; overflow: hidden; white-space:nowrap; }多行: .box{ word-break: break-word; text-overflow:ellipsis; overflow: hidden; display: ...
2019-03-11 18:26:38
258
原创 vue-cli中引入jquery的方法
第一步:安装jquery,我使用yarn,yarn add jquery第二步:配置 webpack.base.conf.js 位于build文件夹下在顶部加入代码const webpack = require("webpack")在 module.exports = {} 中加入plugins plugins: [ new webpack.optimiz...
2019-02-26 11:47:29
1099
原创 jquery跨域
$.ajax({ url: "url", type: "POST", async: true, data: {}, dataType: "json", xhrFields: { withCredentials: true },//跨域的设置 success: function (res) { console.log(res) }, error: fu...
2019-02-20 16:53:42
862
原创 时间戳转日期的方法
function timestampToTime(timestamp) { var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = date.getFullYear() + '年'; var M = (date.getMonth()+1 < 10 ? '0'+(date.getM...
2019-01-30 11:34:22
1523
转载 file accept类型收集
限制只能选择图片<input type="file" accept="image/*">限制只能选择视频<input type="file" accept="video/*">限制只能选择音频<input type="file" accept="audio/*">直接打开摄像头拍照
2019-01-17 14:45:05
1033
原创 基于element UI的省(市)(区)三级(二级)(一级)联动数据以及使用方法
使用方法:<el-form-item label="省/市/区" required prop="homeDistrict"> <el-cascader expand-trigger="hover" :options="options" @change="handleChange" >
2018-12-26 17:10:33
6539
5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人