上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: vue中的computed无法直接像methos一样传参,但我们可以使用利用闭包 computed:{ getDisabled(){ return (row)=>{ return row.id=1 } } } 阅读全文
posted @ 2021-04-10 23:16 coffeemil 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 微信小程序: 认证 获取appid 生成secret 开通支付 关联商户号 微信商户号: 认证 获取商户mch_id 设置商户API密钥(mch_key) 绑定appid 配置支付接口 wx.login 拿到 code 把code传给后端...... 后端返回openid 用openid传给后端请求 阅读全文
posted @ 2021-03-31 03:42 coffeemil 阅读(575) 评论(0) 推荐(0) 编辑
摘要: v-mode l等价于 :value 加 @input //父组件<template> <div id="app"> <Son v-model="str" /> {{str}} </div> </template> <script> import Son from "./components/son 阅读全文
posted @ 2021-03-31 03:36 coffeemil 阅读(335) 评论(0) 推荐(0) 编辑
摘要: v-bind 和 v-model 连用的妙用 实现checkbox全选,取消全选 <template> <div> 全选<input type="checkbox" v-model="all" /> <br /> <ul> <li v-for="item in list" :key="item.id 阅读全文
posted @ 2021-03-31 03:17 coffeemil 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 两种获取地址参数方法 //query方式this.$route.query.变量//动态路由方式this.$route.params.变量 编程式导航 跳转传参 this.$router.push({ path:'', //可手写地址 name:'' //name需要在路由上面配置name属性才可以 阅读全文
posted @ 2021-03-28 19:43 coffeemil 阅读(99) 评论(0) 推荐(0) 编辑
摘要: //history.pushState附加哈希值并不会触发onhashchange var newHash = 'test'; history.replaceState(null, null, window.location.pathname + '#' + newHash); Hash模式底层思想 阅读全文
posted @ 2021-03-27 05:15 coffeemil 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 路由懒加载 当打包构建应用时,JavaScript 包会变得非常大,影响页面加载。如果我们能把不同路由对应的组件分割成不同的代码块,然后当路由被访问的时候才加载对应组件,这样就更加高效了。 如何定义一个能够被 Webpack 自动代码分割的异步组件? const Foo = () => import 阅读全文
posted @ 2021-03-27 03:26 coffeemil 阅读(64) 评论(0) 推荐(0) 编辑
摘要: while遍历 可以使用 break, continue ,return 普通for循环 可以使用 break, continue,不能return forEach 遍历数组 可以抛出异常 throw new Error("这个是异常")不能 break,continue,return for... 阅读全文
posted @ 2020-12-15 19:40 coffeemil 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 都是基于父级下面的元素 nth-child 基于父级下面的第N个元素,如果类型匹配则生效 nth-of-type 基于父级下面的第N个相同类型的元素 odd:奇数 even:偶数 n:变量 example <a/> <p/> <a/> a:nth-child(2) 不生效a:nth-of-type( 阅读全文
posted @ 2020-12-02 16:03 coffeemil 阅读(24) 评论(0) 推荐(0) 编辑
摘要: __proto__是原型,原型链就是一直查找__proto__ ,直到返回值为null。 (new对象.__proto__.__proto__.__proto__) 返回值为null 阅读全文
posted @ 2020-11-25 21:10 coffeemil 阅读(46) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页