Skip to content

Instantly share code, notes, and snippets.

@jdswee
jdswee / dateFormat.js
Created November 18, 2019 15:15
Vue 日期时间格式化过滤器
Vue.filter('dateFormat', function (value) {
if(!value) return ''
return moment(value).format('YYYY-MM-DD HH:mm:ss')
})
@jdswee
jdswee / trimspace.js
Created April 5, 2017 06:40
去除输入字符串前后的空格
// 去除输入字符串前后的空格
function trimSpace(string) {
return $.trim(string);
}
@jdswee
jdswee / countdown.js
Created April 5, 2017 06:39
倒计时
// 倒计时60秒
var waittime = 60;
function countDown(o) {
if (waittime === 0) {
$(o).val("获取验证码").css("color", "#f23f3f");
waittime = 60;
$(o).removeAttr("disabled");
} else {
$(o).attr("disabled", true);
$(o).val(waittime + "s后重新发送").css("color", "#999");
@jdswee
jdswee / gist:88f0508c8b5968866864a8a824b5a333
Last active March 29, 2017 06:57
动态改变html的font-size
!function(e) {
function t(a) {
if (i[a])
return i[a].exports;
var n = i[a] = {
exports: {},
id: a,
loaded: !1
};
return e[a].call(n.exports, n, n.exports, t),