- 博客(142)
- 收藏
- 关注
原创 ali-oss 上传图片
/* * @Author: zhanggenyuan 834390901@qq.com * @Date: 2022-05-17 13:48:59 * @LastEditors: zhanggenyuan 834390901@qq.com * @LastEditTime: 2022-05-17 13:50:51 * @FilePath: \admin-web\src\api\ali-oss.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileH
2022-05-17 18:20:33
623
1
原创 Vue 钉钉扫码登录
2.X<template> <div id="app"> <div id="login_container"></div> </div></template><script>export default { components: {}, data() { return { redirect: undefined, appid: 'ding8lrom1le5z
2022-05-08 21:07:24
1196
原创 正则表达式
const MOBILE_REG = /^1\d{10}$/; // 验证手机号const EMAIL_REG = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/; // 验证邮箱const MONEY_REG = /^([1-9][\d]{0,7}|0)(\.[\d]{1,2})?$/; // 验证RMBconst NAME_REG = /^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$/; // 名字(包括中文、英文、数字)const C.
2022-05-02 17:22:20
245
原创 Mac升级node版本
sudo npm cache clean -f //清除nodejs的cachesudo npm install -g n //使用npm安装n模块npm view node versions // node所有版本sudo n 15.0.0 // 指定版本sudo n latest // 升级到最新版本sudo n stable // 升级到稳定版本sudo n xx.xx // 升级到具体版本号...
2022-04-23 22:29:16
1405
原创 Vue React 等 一键复制
npmjs文档下载npm i use-light-copy --save使用支持Promise.then 返回Boolean true为复制成功/** @name: toCopy* @test: test font* @msg:* @param text:String options:Object =>{debug:Boolean}* @return Promise=>then(res:Boolean)*/const { toCopy } = require('u
2022-04-11 15:38:04
1010
原创 node Vite 读取文件夹中所有文件
const path = require(‘path’)const files = require.context(’@/components/home’, false, /.vue$/)const modules = {}files.keys().forEach(key => {undefinedconst name = path.basename(key, ‘.vue’) //返回文件名 不含后缀名content= files(key).default || files(key)})
2022-04-10 17:54:10
7782
原创 Tinymce 设置CV图片
initTinymce() { const _this = this window.tinymce.init({ selector: `#${this.tinymceId}`, language: this.languageTypeList['en'], height: this.height, body_class: 'panel-body ', object_resizing: false,
2022-04-08 14:40:46
289
原创 前端导出文件
npm链接npm install js-file-download --savefunction download(id) { return new Promise((resolve, reject) => { axios.get(`${url}id`, { responseType: 'blob', headers: { 'Content-Type': 'application/octet-stream' }
2022-03-30 13:32:37
1145
原创 nodejs multer封装 上传文件
<template> <el-upload class="upload-demo" drag action="http://127.0.0.1:3000/upload/upload" multiple > <i class="el-icon-upload"></i> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em>&
2022-02-28 16:03:12
390
原创 sass切换主题
@mixin theme { color: #fff; background-color: #000; [data-theme="theme1"] & { color: #f00; background-color: antiquewhite; } [data-theme="theme2"] & { color: green; background-color: aqua; } [data-theme="theme3"] &
2022-02-11 22:09:27
705
原创 Vue切片上传
<template> <div> <input type="file" @change="handleFileChange" /> <el-button @click="handleUpload">上传</el-button> </div></template><script>const SIZE = 10 * 1024; // 切片大小expo
2021-12-30 13:40:19
1003
原创 Vue 配置cdn 优化
vue.config.js chainWebpack(config) { config.plugin("preload").tap(() => [ { rel: "preload", fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], include: "initial" } ]); config.set("external
2021-12-27 09:21:20
509
原创 正则匹配图片 ,视频
export function fixImg(htmlstr:string):string{ //正则匹配所有img标签 //var regex0 = new RegExp("(i?)(\<img)([^\>]+\>)","gmi"); //正则匹配不含style="" 或 style='' 的img标签 var regex1 = new RegExp("(i?)(\<img)(?!(.*?style=['\"](.*)['\"])[^\>]+\>)","
2021-11-23 15:35:54
1929
原创 Vue 接入 科大讯飞
audio.js/* * @Autor: zhanggenyuan * @Date: 2021-11-09 17:40:51 * @Description: *//* * @Autor: lycheng * @Date: 2020-01-13 16:12:22 *//** * Created by iflytek on 2019/11/19. * * 在线语音合成调用demo * 此demo只是一个简单的调用示例,不适合用到实际生产环境中 * * 在线语音合成 WebAPI
2021-11-09 17:53:31
1153
原创 Vue 语音播报
<template> <div> <h1>111111111</h1> <i @click="reader" class="el-icon-microphone"></i> <div id="group">{{ words }}</div> </div></template><script>export default { data
2021-11-09 16:21:37
2208
原创 axios 缓存 Token无痛刷新
/* * @Author: zhang gen yuan * @Date: 2021-10-09 17:51:00 * @Descripttion: */import axios from 'axios' // 数据存储export const cache = { data: {}, set (key, data, bol = false) { if (bol) { localStorage.setItem(key, JSON.stringify(data))
2021-10-09 17:55:59
426
原创 轮播一页显示多少条数据
// array 展示swiper的数组 // size 每页展示数据的个数 swiper(arr, size) { // 定义好全局this指向 let that = this; // 获取数组长度 var length = arr.length; // 一共可以分为几页,ceil:取整,有小数点加一 例如:1.2 取 2 var page = Math.ceil(length / size);.
2021-10-08 09:24:27
333
原创 Vue新手指引
driver.jsnpm install driver.js --saveutils / driver.jsexport default [ { element: '#some-element1', popover: { title: '第一项', description: '第一项的描述', position: 'bottom', } }, { ele
2021-09-24 11:03:34
1469
转载 performance 优化
https://www.cnblogs.com/tugenhua0707/p/10982332.html 本文转载 Performance --- 前端性能监控 2019-06-05 22:23 龙恩0707 阅读(4429) 评论(1) 编辑 收藏 举报 Performanc
2021-09-18 15:52:13
1580
原创 electron
// 如果安装失败npm install --save-dev electron-chromedrivervue add electron-builder
2021-09-16 22:16:20
150
转载 css 动画 打字效果
本文借鉴 https://blog.youkuaiyun.com/weixin_39843414/article/details/119792197使用 CSS 实现打字效果 <h1>Pure CSS Typing animation.</h1><style lang="scss">h1 { font-family: monospace; width: 26ch; white-space: nowrap; overflow: hidden; animat
2021-09-16 10:28:38
159
原创 NProgress
npm install --save nprogressrouter.jsimport NProgress from 'nprogress'import 'nprogress/nprogress.css'router.beforeEach((to, from, next) => { NProgress.start() next()})router.afterEach(() => { NProgress.done()})App.vue 改变自定义颜色#n
2021-09-15 17:07:15
157
原创 flyio 无感刷新token
npm install flyiovar Fly=require('flyio/dist/npm/wx');var fly=new Fly();<!DOCTYPE html><html><head lang="zh-cmn-Hans"> <meta charset="UTF-8"> <title>Fly.js Demo</title> <meta name="renderer" content
2021-09-14 22:21:22
452
原创 refreshToken
import store from '@/store'import config from './config.js'import Base64 from './base64.js'// H5版本// #ifdef H5import Fly from "flyio/dist/npm/fly"// #endif//微信小程序和APP版本// #ifndef H5import Fly from "flyio/dist/npm/wx"// #endifconst request = new
2021-09-13 16:22:58
196
原创 simplest-i18n
main.jsimport t from './t';Vue.prototype.$t = t;getLang.jsimport store from './store/index'const langs = ['zh-CN', 'en']const getLang = { lang:store.state.lang, langs}export default getLang;t.jsimport i18n from 'simplest-i18n';import
2021-09-13 13:40:11
206
原创 uni拦截器
// common/request.js// 目前没有针对uni的Fly版本,使用wx版本没有问题import store from '@/store'import config from './config.js'import Base64 from './base64.js'// H5版本// #ifdef H5import Fly from "flyio/dist/npm/fly"// #endif//微信小程序和APP版本// #ifndef H5import Fly fr
2021-09-09 16:07:42
347
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人