摘要: 定义 当一个style标签拥有scoped属性时,它的CSS样式就只能作用于当前的组件,也就是说,该样式只能适用于当前组件元素。 通过该属性,可使组件之间的样式不互相污染。如果一个项目中的所有style标签全部加上了scoped,相当于实现了样式的模块化。 实现原理 实现原理是给dom添加了一个独一 阅读全文
posted @ 2020-01-09 10:03 把我当做一棵树叭 阅读(341) 评论(0) 推荐(0)
摘要: 概念 正则表达式是由一个字符序列形成的搜索模式。 语法 /正则表达式主体/修饰符(可选) let regex= /xyz/i let regex= new RegExp(/xyz/i) let regex= new RegExp('xyz','i') 修饰符 g:执行全局匹配 i:执行对大小写不敏感 阅读全文
posted @ 2020-01-08 17:42 把我当做一棵树叭 阅读(480) 评论(0) 推荐(0)
摘要: getCode () { const AppId = '你的微信公众号appid' const code = this.getQueryVariable('code') const local = window.location.href if (code == null || code '') { 阅读全文
posted @ 2020-01-08 16:55 把我当做一棵树叭 阅读(452) 评论(0) 推荐(0)
摘要: 防抖debounce 在事件被触发n秒后执行,如果在这n秒内又被触发,则重新计时。业务场景比如远程搜索;按钮提交,防止多次提交只执行最后一次; //防抖函数 const debounce = (fn,delay)=>{ let timer = null; return (...args)=>{ cl 阅读全文
posted @ 2020-01-07 17:48 把我当做一棵树叭 阅读(268) 评论(0) 推荐(0)
摘要: 小程序应用生命周期 我们知道小程序有应用生命周期和页面生命周期 在App.vue中可以监听应用生命周期: onLaunch onShow onHide onError onUniNViewMessage 页面生命周期 onLoad onShow onReady onHide onUnload ... 阅读全文
posted @ 2020-01-03 11:22 把我当做一棵树叭 阅读(4249) 评论(0) 推荐(0)
摘要: css层叠样式表 注释 /*这是注释*/ 插入样式表 1.外部样式表 <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> </head> 2.内部样式表 <style> hr {color:sienna;} p {mar 阅读全文
posted @ 2020-01-02 16:03 把我当做一棵树叭 阅读(211) 评论(0) 推荐(0)
摘要: 本次小程序的开发使用uni app+vant weapp,vant weapp如何引用和部分组件使用方法如下 引入 在github(https://github.com/youzan/vant-weapp)下载dist文件,在项目目录下创建wxcomponents/vant,把dist文件复制进来 阅读全文
posted @ 2019-12-31 17:08 把我当做一棵树叭 阅读(7261) 评论(1) 推荐(1)
摘要: 1.npm安装 npm install @dcloudio/uni-ui 2.js引用 import {uniLoadMore, uniDrawer, uniIcons} from '@dcloudio/uni-ui' components: { uniLoadMore, uniDrawer, un 阅读全文
posted @ 2019-12-31 16:59 把我当做一棵树叭 阅读(2956) 评论(0) 推荐(0)
摘要: 边框 border-radius圆角边框 四个值: 第一个值为左上角,第二个值为右上角,第三个值为右下角,第四个值为左下角。 三个值: 第一个值为左上角, 第二个值为右上角和左下角,第三个值为右下角 两个值: 第一个值为左上角与右下角,第二个值为右上角与左下角 一个值: 四个圆角值相同 box-sh 阅读全文
posted @ 2019-12-30 21:23 把我当做一棵树叭 阅读(271) 评论(0) 推荐(0)
摘要: 添加控制台,在移动端就能看到 npm安装 npm install vconsole 页面中的引用 import vConsole from 'vconsole' mounted () { let v = new vConsole() }, 阅读全文
posted @ 2019-12-30 17:29 把我当做一棵树叭 阅读(236) 评论(0) 推荐(0)