会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
落灯花
博客园
首页
新随笔
联系
订阅
管理
2022年2月25日
常见函数
摘要: 防抖: function debounce(fn, delay){ let timer return function(...args) { if(timer){ clearTimeout(timer) } timer = setTimeout(() => { fn.apply(this,args)
阅读全文
posted @ 2022-02-25 15:27 落灯花
阅读(46)
评论(0)
推荐(0)
2021年10月27日
nuxt.js middleware 中间件实现判断手机端跳转
摘要: vue里面写法如下: export default function ({ isServer, req, redirect, route }) { let pcOrigin = 'https://www.xxxxx.com' let mobileOrigin = 'https://m.xxxxx.c
阅读全文
posted @ 2021-10-27 09:55 落灯花
阅读(701)
评论(0)
推荐(0)
2021年10月26日
tiptap 编辑器显示源码
摘要: showSource() { let _this = this _this.isHTML = !_this.isHTML let _source = this.editor.getHTML() if (_this.isHTML) { _source = _source.replace(/</g, "
阅读全文
posted @ 2021-10-26 14:59 落灯花
阅读(108)
评论(0)
推荐(0)
2021年10月9日
javaScript的基本优雅写法
摘要: 1.判断为空 小白: if(a == undefined) a = []; if(params.success){ params.success(res); } 优雅: a = a || []; params.success&¶ms.success(res); 2.多条件判断 小白: var
阅读全文
posted @ 2021-10-09 15:00 落灯花
阅读(91)
评论(0)
推荐(0)
2021年7月5日
vue+element 多个checkbox+select思路及方式
摘要: HTML: <el-checkbox-group v-model="re_hotel" class="col-padding"> <el-col v-for="(hotel_item, hotel_id) in all_hotel_room" :key="hotel_id" :span="8"> <
阅读全文
posted @ 2021-07-05 18:10 落灯花
阅读(944)
评论(0)
推荐(0)
2021年6月7日
钱数三位数添加逗号
摘要: toThousandFilter(num) { return (+num || 0).toFixed(2).replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') }
阅读全文
posted @ 2021-06-07 16:03 落灯花
阅读(125)
评论(0)
推荐(0)
2021年5月25日
本月时间按天显示
摘要: 时间按天数显示 getAllDate(start, end) { // 中国标准时间format yyyy-mm-dd const format = (time) => { let ymd = '' const mouth = (time.getMonth() + 1) >= 10 ? (time.
阅读全文
posted @ 2021-05-25 19:51 落灯花
阅读(54)
评论(0)
推荐(0)
2021年5月17日
微信小程序----当前时间的时段选择器插件(今天、本周、本月、本季度、本年、自定义时段)
摘要: 创建getperiod.js class GetPeriod{ constructor() { this.now = new Date(); this.nowYear = this.now.getYear(); //当前年 this.nowMonth = this.now.getMonth(); /
阅读全文
posted @ 2021-05-17 12:03 落灯花
阅读(961)
评论(0)
推荐(0)
2021年4月6日
vuex进行传值
摘要: 为什么使用vuex? vuex主要是是做数据交互,父子组件传值可以很容易办到,但是兄弟组件间传值(兄弟组件下又有父子组件),或者大型spa单页面框架项目,页面多并且一层嵌套一层的传值,异常麻烦,用vuex来维护共有的状态或数据会显得得心应手。 需求:两个组件A和B,vuex维护的公共数据是 餐馆的名
阅读全文
posted @ 2021-04-06 14:38 落灯花
阅读(1409)
评论(0)
推荐(0)
2021年4月5日
echart 自定义 formatter
摘要: formatter: function(params) { var relVal = [params[0].name]; for (var i=0;i<params.length;i++){ relVal += '\n' + params[i].seriesName+' ' + params[i].
阅读全文
posted @ 2021-04-05 14:23 落灯花
阅读(1266)
评论(0)
推荐(0)
下一页
公告