This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Widget { | |
constructor(width, height, label) { | |
this.width = width || 50; | |
this.height = height || 50; | |
this.$elem = null; | |
} | |
render($where){ | |
if(this.$elem) { | |
this.$elem.css({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /userinfo/2144/id => ['/userinfo','/useinfo/2144,'/userindo/2144/id'] | |
export function urlToList(url) { | |
const urllist = url.split('/').filter(i => i); | |
return urllist.map((urlItem, index) => { | |
return `/${urllist.slice(0, index + 1).join('/')}`; | |
}); | |
} | |
// 极坐标转换成笛卡尔坐标 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function($) { | |
var startPos, // 开始触摸点(X/Y坐标) | |
endPos, | |
stage, // 用于标识 onStart/onMove/onEnd 流程的第几阶段,解决 onEnd 重复调用 | |
offset, // 偏移距离 | |
direction, // 翻页方向 | |
curPage, // page 当前页 | |
pageCount, // page 数量 | |
pageWidth, // page 宽度 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function arrayToCSV (twoDiArray) { | |
// Modified from: http://stackoverflow.com/questions/17836273/ | |
// export-javascript-data-to-csv-file-without-server-interaction | |
var csvRows = []; | |
// for (var i = 0; i < twoDiArray.length; ++i) { | |
// for (var j = 0; j < twoDiArray[i].length; ++j) { | |
// console.log(twoDiArray[i][j]) | |
// temp[i][j] = '\"' + `${dateFns.format(twoDiArray[i][j].timestamp,'HH:mm:ss')}` + '\"'; // Handle elements that contain comma | |
// } | |
// csvRows.push(temp[i].join(',')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>forvue</title> | |
</head> | |
<body> | |
<div id="app"> | |
<input type="text" v-model="text"> <br> | |
{{ text }} <br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// atomBackup |
NewerOlder