- 博客(12)
- 收藏
- 关注
原创 js 实现私有变量的一种方法
临时变量存储数据 拦截实例函数 注入读取写入状态如代码:export function objPrivate(){ let isInPrivate = [false]; const _cacheds=new Map() const getPrivateStatus=()=>{ return isInPrivate[isInPrivate.length-1] } const makePrivate = function(fun){..
2021-09-28 08:54:31
234
原创 vue jsx使用-简单的form表单合并
jsx 使用文档:https://cn.vuejs.org/v2/guide/render-function.html例子:<script >import * as _ from 'lodash'import { reduce } from '../../util/func.js'export default { props: { showBtn: { ...
2019-05-14 13:31:28
2605
原创 老代码java web的前后端分离
接触到一个老的java web 项目,以前是前后放在一个项目里 目录如下jsp 代码 大致如下:采用gulp 分离jsp 转成模板 使用gulp-file-include 引入模板大致如下:gulp-html:const compressHtm = require('gulp-htmlmin')const fileinclude = ...
2019-04-29 00:28:34
782
原创 手机webApp rem适配的问题
一般是设置html的fontsize 为一个合适的值这里 设置为20rem(界面宽度) 和 微信小程序 一样,可以重用html 的font-size 就为 clientWidth/20如下(0, function () { if (typeof process !== 'undefined' && !process.browser) { re...
2019-01-03 15:25:51
298
原创 viewport 小知识
开发移动webapp 时,都会用到viewport。按字面意思,就是视点,瞭望口,这里理解为网页的绘制区域有几个属性 width initial-scale 有三个关键字 (document.documentElement)clientWidth, deviceWidth,(window)innerWidthwidth 就是clientWidth deviceWidth ...
2019-01-02 19:59:17
178
原创 微信一笔画游戏 的 路径算法
最近 地铁 上玩这个 然后想了想 路径 算法 只会穷举~ function findWay(m, n,/*空点 不能走*/emptyArrs,/*起点*/start) { let totalPoint = m * n; let inTotalPoint = 1; console.time('a44') function init() { let mn = ...
2018-10-24 10:44:11
2064
1
原创 koa 中间件 的 错误抛出
错误处理的时候遇到的一个问题一般错误处理koa.use(async (ctx,next)=>{ try{ await next(); console.log('next executed') } catch(e){ console.error(e); ...
2018-08-07 09:32:48
1034
原创 react-native 开发 遇到的 ios 和 android 的 一些兼容问题
1.textinput android 默认有下划线 ios 无2.text android 默认背景透明 ios 无3.overflow:hidden android 没效果 超出部分不可见 ios 可以4. image的 borderTopLeftRadius ios 不可以 可以外面 套一层5.scrollview scroll...
2018-08-06 11:10:17
2339
1
原创 react-native scrollview里面的listview里面的button 无法响应
参阅touchable.js 设置rejectResponderTermination 为true 即可
2018-07-16 17:30:10
501
原创 Promise 的取消
有时候需要取消Promise const CancelEerr = "CANCEL"class CancelPromise { constructor(fun,/* 后续的任务都取消 */isDeep = false) { this.prom = new Promise(fun) this._cancel = false; this._beforeCac...
2018-07-13 10:41:06
3228
原创 vue 自定义grid
基于element-ui grid 的 简单封装grid<template> <div> <el-table :data="rows" stripe border :show-header="showHeader" style="width:100%...
2018-07-13 09:58:22
4837
原创 vue slot-scope+render的一些用法
使用vue的时候经常会遇到以下情况,比如 <el-table-column prop="createYmd" label="入驻日期" align="center" :formatter="renderYmd"></el-table-column> <el-table-column label="商户名称
2018-04-20 20:38:35
6393
3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人