- 博客(5)
- 收藏
- 关注
原创 Echart axisLabel 文字设置行高
先看图echarts坐标文字默认看着比较拥挤,如果想要设置行高需要通过配置富文本样式,如下:axisLabel: { color: 'black', interval: 0, formatter(val) { return '{a|' + `${val.slice(0, 4)}\n${val.slice(4)}` +'}' }, rich: { a: { height: 20, // 设置字体行高 } }},...
2021-09-16 15:46:09 2631
原创 Echarts 空数据时展示自定义矢量图
话不多说,直接贴配置~~options = { title: { show: isEmpty, // 是否要展示“暂无数据”矢量图 text: ' {a|}', // 写入占位符a,以便后续填充内容 x: 'center', y: 'center', subtext: '暂无数据', // 子标题 itemGap: -10, // 设置主副标题间隔 textStyle: { rich: { a: {
2021-09-09 18:46:05 689
原创 解决vue-router报错NavigationDuplicated: Avoided redundant navigation to current location:
问题说明:vue-router使用过程中,重复触发了同一个路由,导致控制台报错:避免到当前位置的冗余导航;(该错误不影响正常功能)解决思路:重写原型对象中的push方法,捕捉错误// 获取原型对象上的push函数const originalPush = Router.prototype.push// 修改原型对象中的push方法,捕捉错误Router.prototype.push = function push(location) { return originalPush.call(th
2021-06-07 16:31:04 644
原创 lodash之_.dropwhile理解
使用.dropWhile(array, [predicate=.identity])创建一个切片数组,去除array中从起点开始到 predicate 返回假值结束部分。predicate 会传入3个参数: (value, index, array)。例子var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'ac
2021-04-12 17:07:28 296
原创 koa + 前端文件传输
1. 安装并引入koa-bodynpm i koa-body -sconst koaBody = require('koa-body');app.use(koaBody({ multipart: true // 支持文件格式})).listen(3000)2. 上传文件接口const fs = require('fs');const path = require('path');router.post('/uploadfile', async (ctx) => {
2021-04-08 16:11:19 857
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人