Skip to content

Instantly share code, notes, and snippets.

View hidoos's full-sized avatar
🏠
Working from home

hong lan hidoos

🏠
Working from home
  • GuiYang, China
View GitHub Profile
@moonflame
moonflame / DatetimePicker_bug.js
Last active June 23, 2020 09:00
DatetimePicker bug (Vant Weapp)
Page({
data: {
currentDate: new Date().getTime(),
minDate: new Date().getTime()
},
onInput(event) {
this.setData({
currentDate: event.detail,
});

2.6 Internal Change: Reverting nextTick to Always Use Microtask

The Original Problem

When Vue detects data mutation, it asynchronously defer DOM updates to the next "tick" so that multiple mutations trigger only one update cycle. In versions before 2.5, Vue has been deferring updates using what is known as the "Microtask" (as explained in this blog post).

This works fine in most situations, but we discovered an edge case:

  1. Given two nested elements, "outer" and "inner";
  2. "inner" has a click event handler which triggers an update
@Ariex
Ariex / Promise.allInOrder.js
Last active February 17, 2022 07:31
Promise.allInOrder
// v3 is shorter than v2, and achieve same goal
(()=>{
let Deferred = function(){
let resolver, rejector,
promise = new Promise((resolve, reject)=>{
resolver = resolve;
rejector = reject;
});
promise.resolve = d=>resolver(d);
promise.reject = d=>rejector(d);
@JoeNoPhoto
JoeNoPhoto / Add,Remove, and Increment,Avoiding Array Mutations with concat(), slice(), and ...spread.js
Last active July 5, 2023 09:29
(ES6) Avoiding Array Mutations with concat(), slice(), and ...spread
const addCounter = (list) => {
return [...list, 0];
};
const removeCounter = (list, index) => {\
return [
...list.slice(0, index),
...list.slice(index + 1)
];
};
anonymous
anonymous / dabblet.css
Created January 14, 2014 15:26
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
:root {
background-color: #6374AB;
padding: 50px;
}
ul{
background:yellow;
margin:0;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
'use strict';
var moment = require('moment');
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
@xkyii
xkyii / git乱码解决方案汇总.txt
Created July 13, 2011 05:41
git乱码解决方案汇总
原帖地址: http://topic.csdn.net/u/20110113/19/b0d5d506-4307-428b-a61d-7974aa66a2da.html
首先要说明的是:这里介绍的方法都是大部分是本人“悟”出来的,所以网上难有流传!
好方法不能自己私藏,否则就白忙乎这几天了,分享给有需要的朋友们。如果有转载,敬请注明来自*CSDN老邓*作品。
呵呵,给自己打广告,实在是无耻之极,权当无聊之时打字之用。
欢迎流传,为最优秀的分布式版本管理系统Git做宣传!!
步骤:
1. 下载:http://loaden.googlecode.com/files/gitconfig.7z
2. 解压到:<MsysGit安装目录>/cmd/,例如:D:\Program Files\Git\cmd