摘要: getCurrentPages() 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 在app.js中添加: getCurrentPages: function(){ var pages = getCurrentPages(); //获取加载的页面 阅读全文
posted @ 2019-07-03 11:19 北执666 阅读(11996) 评论(0) 推荐(1) 编辑
摘要: // 替换手机号中间四位 var str = '15912341234'; // 方法一 str.replace(/(\d{3})(\d{4})(\d{3})/, function($0, $1, $2, $3){ console.log($1+"****"+$3) }) // 方法二 str.re 阅读全文
posted @ 2019-05-28 18:52 北执666 阅读(517) 评论(0) 推荐(0) 编辑
摘要: var arr = ['a',1,2,3,'a',4,2,3,1,4,2,8,10,null,'a']; // 方法一 var newArr = [...new Set(arr)]; console.log(newArr); // 方法二 var newArr = arr.reduce( (prev 阅读全文
posted @ 2019-05-28 17:55 北执666 阅读(1497) 评论(0) 推荐(0) 编辑
摘要: <form name="form1" onsubmit="return foo()"> <input type="radio" name="radiogroup1"> <input type="radio" name="radiogroup1"> <input type="radio" name=" 阅读全文
posted @ 2019-05-28 17:44 北执666 阅读(3794) 评论(0) 推荐(0) 编辑
摘要: 方法一: mui('body').on('tap', 'a', function() { if(this.href){ //判断链接是否存在 location.href = this.href; } }); 方法二: $('body').on('tap', 'a', function () { if 阅读全文
posted @ 2019-05-27 14:28 北执666 阅读(589) 评论(0) 推荐(0) 编辑
摘要: 方法1:给form表单加onsubmit事件,值为return false; <form action="" method="post" onsubmit="return false"> <button type="submit" class="btn btn-primary">提交</button 阅读全文
posted @ 2019-04-16 10:58 北执666 阅读(11108) 评论(0) 推荐(3) 编辑
摘要: pc微信浏览器不兼容es6的语法糖。 阅读全文
posted @ 2019-04-11 10:59 北执666 阅读(5811) 评论(0) 推荐(0) 编辑
摘要: var pages = getCurrentPages(); var Page = pages[pages.length - 1];//当前页var prevPage = pages[pages.length - 2]; //上一个页面var info = prevPage.data //取上页da 阅读全文
posted @ 2019-04-11 10:56 北执666 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 根据地址查询经纬度 4 5 6 7 8 9 要查询的地址: 10 查询结果(经纬度): 11 12 20 21 22 23 24 53 阅读全文
posted @ 2018-08-24 14:52 北执666 阅读(1073) 评论(0) 推荐(0) 编辑
摘要: 1.安装node环境 下载地址 https://nodejs.org/en/download/ node -v 安装成功后在命令行查看node版本 npm -v 安装成功后在命令行查看npm版本 2.用npm全局安装工具vue-cli npm install vue-cli -g 3.使用vue-c 阅读全文
posted @ 2018-03-17 15:40 北执666 阅读(244) 评论(0) 推荐(0) 编辑