上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 28 下一页
摘要: ##路由传值 ####路由传值,取值(一个参数) 1、路由部分配置:如router.js页面,在需要取值的页面的路由上添加/:testid { path:'/pUniversity/pUniversityInfo/:testid', //添加/:testid component:pUniversit 阅读全文
posted @ 2020-01-07 09:17 huihuihero 阅读(918) 评论(0) 推荐(0) 编辑
摘要: ####直接看官方文档 const Foo = { template: `...`, beforeRouteEnter (to, from, next) { // 在渲染该组件的对应路由被 confirm 前调用 // 不!能!获取组件实例 `this` // 因为当守卫执行前,组件实例还没被创建 阅读全文
posted @ 2020-01-02 16:25 huihuihero 阅读(8211) 评论(0) 推荐(3) 编辑
摘要: ####经过处理了各种bug后的最终版本代码 在index.html: 引入 <script type="text/javascript" src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script> 在需要做分享功能的页面: cre 阅读全文
posted @ 2020-01-02 14:51 huihuihero 阅读(1067) 评论(0) 推荐(0) 编辑
摘要: 流程: ① 请求微信接口(携带指定参数appid,scope等。及一个回调地址redirect_uri) ② 微信收到请求后会跳转到回调地址redirect_uri,并在该回调地址上携带相关回调参数 ③ 提取相关回调参数传给后台即可 1、获取网页授权(官方文档:https://developers. 阅读全文
posted @ 2019-12-30 09:35 huihuihero 阅读(4491) 评论(2) 推荐(0) 编辑
摘要: ####例子就不举了,直接看区别吧 ####区别: for in是es5的语法,for of是es6的语法 for in除数组还可以用于对象属性的遍历(当然,数组也是对象),for of只能用于数组遍历 for in 获取的是对象的键名, for of遍历获取的是对象的键值 for in会遍历对象的 阅读全文
posted @ 2019-12-27 15:02 huihuihero 阅读(325) 评论(0) 推荐(0) 编辑
摘要: ####以ul,li为例,获取ul下所有li标签 <ul id="nav"> <li>一号</li> <li>二号</li> <li>三号</li> <li>四号</li> </ul> <script> let a=document.getElementById('nav').children // 阅读全文
posted @ 2019-12-27 14:15 huihuihero 阅读(13311) 评论(0) 推荐(0) 编辑
摘要: ###window.scrollTo(x,y) 缺:只能作用于window,不可作用于某一指定元素 优:可以作用于x轴和y轴两个方向 注:scrollTo在安卓手机上存在兼容性问题 ###document.documentElement.scrollTop = 0 缺:只能作用于y轴的方向 优:可以 阅读全文
posted @ 2019-12-24 16:00 huihuihero 阅读(4788) 评论(0) 推荐(1) 编辑
摘要: 点击一个元素,在点击函数里传入其他元素的id,可以拿到其他元素 若函数里传入this,则拿到的是当前被点击的元素本身 阅读全文
posted @ 2019-12-24 10:13 huihuihero 阅读(4679) 评论(0) 推荐(0) 编辑
摘要: ##具体流程(详见文档:https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html) ####1、前端提交申请获取用户授权 let ua = navigator.user 阅读全文
posted @ 2019-12-20 17:48 huihuihero 阅读(359) 评论(0) 推荐(0) 编辑
摘要: cookie localStorage sessionStorage localstorage设置过期时间 阅读全文
posted @ 2019-12-18 10:52 huihuihero 阅读(296) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 28 下一页