Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
因安全机制,window.open在safari 浏览器中屏蔽掉了, 解决办法如下
let newTab = window.open()
setTimeout(() => {
newTab = 'https://www.baidu.com'
}, 500)
const gulp = require('gulp') | |
const sass = require('gulp-sass') | |
const cssnano = require('gulp-cssnano') | |
const rename = require('gulp-rename') | |
const connect = require('gulp-connect') | |
const babel = require('gulp-babel') | |
const uglify = require('gulp-uglify-es').default | |
const imagemin = require('gulp-imagemin') | |
gulp.task('convertCSS', function () { |
//获取指定form中的所有的<input>对象 | |
function getElements(formId) { | |
var form = document.getElementById(formId); | |
var elements = new Array(); | |
var tagElements = form.getElementsByTagName('input'); | |
for (var j = 0; j < tagElements.length; j++){ | |
elements.push(tagElements[j]); | |
} | |
return elements; |
const ajax = (options = {}) => { | |
options.method = (options.method || "GET").toUpperCase() | |
options.dataType = options.dataType || 'json' | |
options.async = options.async || true | |
let xhr = null | |
if (window.XMLHttpRequest) { | |
xhr = new XMLHttpRequest() | |
} else { | |
xhr = new ActiveXObject('Microsoft.XMLHTTP') | |
} |
深圳程序员开发群test
var search = location.search.substring(1); | |
JSON.parse('{"' + decodeURI(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g,'":"') + '"}') |
function time(time = +new Date()) { | |
var date = new Date(time + 8 * 3600 * 1000); | |
return date.toJSON().substr(0, 19).replace('T', ' '); | |
} | |
time(); // "2019-04-18 16:20:22" |
export const hasClass = function(obj, cls) { | |
return obj.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); | |
}; | |
export const addClass = function(obj, cls) { | |
if (!hasClass(obj, cls)) obj.className += ' ' + cls; | |
}; | |
export const removeClass = function(obj, cls) { | |
if (hasClass(obj, cls)) { |
// 获取 url 的查询参数,转为 object | |
const decodeURI = (url = window.location.search) => { | |
return url.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v) | |
} | |
// 1. 判断两个对象是否严格相等,保证isEqual(NaN, NaN)返回true。 | |
// 2. 与Object.is 的区别在于对+0和-0的比较 | |
function isEqual(a, b) { | |
return (a === b || (a !== a && b !== b)); | |
} |