function Person(){
this.name = 'person';
}
function Student(age, gender) {
Person.apply(this, arguments);
this.age = age;
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
```javascript | |
(function{ | |
if(window.DeviceMotionEvent) { | |
alert('you'); | |
window.addEventListener('devicemotion', deviceMotionHandler, false); | |
}else{ | |
alert('no'); | |
} | |
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 (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) |
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
/* | |
用途:检查输入的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) ) { |
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
/** | |
* 导出csv文件 | |
* @see https://gist.github.com/dannypule/48418b4cd8223104c6c92e3016fc0f61 | |
*/ | |
class json2csv { | |
exportCSVFile(headers, items, fileTitle) { | |
if (headers) { | |
items.unshift(headers); | |
} |
see https://cli.vuejs.org/zh/guide/prototyping.html
# install
npm install -g @vue/cli-service-global
# run
vue serve TodoApp.vue
OlderNewer