- 博客(23)
- 收藏
- 关注
原创 WEB性能优化
1. 使用 class 操作样式,而不是频繁操作 style2. 避免使用 table 布局3. 批量dom 操作,例如 createDocumentFragment,或者使用框架,例如 React4. Debounce window resize 事件5. 对 dom 属性的读写要分离6. will-change: transform 做优化...
2020-06-22 23:07:23
217
原创 Vue 组件 emit事件,JSX获取
//组件 JSX语法 components:{ diglog, testCom:{ props:{}, render(h){//子组件this.$emit('getVlaue',this.digput) return (<diglog on-getVlaue={this.handleCom}></di...
2020-03-04 16:29:33
5539
3
原创 获取页面dom渲染时间,内存占用,响应耗时,TCP连接耗时
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-...
2020-03-03 09:50:33
4656
1
原创 JSX实现v-model
//只是截取了部分代码 { label: "时间", prop: "date", fixed: true, width: 150, textAlign: "center", renderCell(h, scope) { const {column,row}=scope...
2020-02-13 09:56:14
8191
原创 git 发布到远程分支
git push提交报错:当前版本低于远程仓库版本。解决办法(1):可以新建分支 git branch myself2然后再git push -u origin myself2 ! [rejected] master -> master (non-fast-forward)hint: Updates were rejected becaus...
2019-03-27 09:51:51
1807
原创 webpack.dev.conf.js mock数据配置
'use strict'const utils = require('./utils')const webpack = require('webpack')const config = require('../config')const merge = require('webpack-merge')const path = require('path')const baseWebp...
2019-03-12 16:36:25
597
原创 router-view 使用
<router-view> 组件是一个 functional 组件,渲染路径匹配到的视图组件。<router-view> 渲染的组件还可以内嵌自己的 <router-view>,根据嵌套路径,渲染嵌套组件。router-view官方讲解router-view demo https://router.vuejs.org/zh/guide/#html...
2019-02-19 15:11:42
2832
原创 兼容IE8,Function.prototype.bind()重写
IE8环境下面可正常执行 if (!Function.bind) { // ie8下可正常执行 Function.prototype.bind = function (context) { if (typeof this !== 'function') { throw new Error('调用的对象不是方法'); ...
2019-02-15 17:08:50
383
原创 获取当前时间
function getNowDate() {let myDate = new Date();//获取系统当前时间let month = myDate.getMonth()< 10 ? "0"+(myDate.getMonth() + 1) : myDate.getMonth() + 1;let date = myDate.getDate() < 10 ? "0" + (m...
2019-01-31 14:01:07
486
原创 radio的坑,因为name不一致,导致单选失效
<input type="radio" id="cnone" name="extend" value="" checked /> <label for="cnone">11</label>
2018-12-28 08:34:37
1249
原创 JS默认参数使用
function multiply3(a,b=3,c){ return a*b*c };multiply3(2,undefined,4) //24
2018-11-27 16:33:35
1561
原创 vue-i18n 报错解决
如图,出现如上问题,该咋办?见代码(下面是修改后的代码),需安装'js-cookie',并且在locale那里使用,同时messages 里面的写法需注意,{... zh}的写法import Vue from "vue"import VueI18n from 'vue-i18n'import Cookies from 'js-cookie'import zh from './z...
2018-11-06 15:09:05
5616
原创 解决 jq ui 弹框 select2 input 失效问题
// jq dialog 弹框var diagFn=function(){ $(".ui-widget-overlay").show(); //html页面的div $("#diag-div").dialog({ resizable:false, width: 500, modal: fa...
2018-10-18 12:28:27
932
原创 Js 模板字符串函数传参写法
如下片段,两小撇,里面为html, value为变量里面可以为具体的值,id同理也是,onclick调用函数,直接写名,然后传递变量${id} //参数变量名如果为常量,直接写 'xxxx',非常方便。 var html=` <a title=${value} rowId=${id} href=# onclick=test(...
2018-09-19 08:29:06
7346
2
原创 打分评价Demo,5颗星(copy可直接运行)
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>打分</title> </head><style> .clickSta
2018-08-24 11:07:04
450
1
转载 module.exports 用法
module.exports 对象是由模块系统创建的。在我们自己写模块的时候,需要在模块最后写好模块接口,声明这个模块对外暴露什么内容,module.exports 提供了暴露接口的方法。1、返回一个JSON Objectvar app = { name: 'app', version: '1.0.0', sayName: function(name){ c...
2018-07-15 11:15:03
4429
原创 reverse反转
<!DOCTYPE html><html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> <script src="https://cdn.bootcss
2018-06-18 20:45:14
196
原创 css3 transition 多个属性的用法
<style media="screen"> .main{ margin: auto; margin-top: 100px; width: 200px; height: 200px; background: linear-gradient(to top right,pink,green); border-radius: 50%; transitio...
2018-05-30 18:34:59
44055
3
原创 使用Jquery ajax及Node后端实现图片上传功能
Node 后端代码:const express = require("express");const router = express.Router();const fs =require("fs");const multer =require("multer");const upload = multer({ dest: "upload/"}) ;const single...
2018-05-26 11:50:35
692
原创 使用jquery ,动态获取option里面的值
下面使用了jquery,具体例子如下 <body><div class="test1"> <select class="sel" name="change"> <option value="aaaaaaaaaaaaaaa">aaaaaaaaaaaaaaa</option>
2018-05-17 08:24:14
1706
原创 JS 的Map() 方法 使用
var m = new Map(); //new一个对象 ,键值唯一m.set(1, "aaaaaaa"); // 添加值m.set(2, "dddddd"); m.set("h", [1,4,3,5,6,]);m.set("sex", 2);m.set({a:2}, 3); m.set({a:2}, 3);// 只会输出一个来//遍历打印效果,期待吧~~m.forEach(function (...
2018-05-04 16:31:47
5470
1
原创 npm start 端口修改(window系统环境下)
如下步骤,window系统进入到运行环境下,cmd运行关闭,如下命令自动失效set PORT=8081 npm start
2018-04-24 08:32:50
3415
原创 JSON.stringify()和JSON.parse()含义
json类型的数据包含json对象和json类型的字符串JSON.stringify(),将JSON对象转换为JSON类型的字符串JSON.parse(),将JSON类型的字符串转换为JSON对象
2018-03-10 11:02:40
763
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人