新人
this-way
修道 修道
展开
-
setstate -> 多次调用合并
最近在获取state改变后的值时遇到问题 问题:同一函数中多次调用setstate 发现并不是逐一执行set的 代码: componentDidUpdate(){ console.log(this.state.test,1) } componentWillUnmount(){ console.log(this.state.test,2) } function test(){ console.log(this.state.test) // 0 this.setState({test:this.s原创 2022-01-27 14:45:12 · 1807 阅读 · 0 评论 -
行高,词间距、字间距
// 词间距 定义单词间的距离 word-spacing: 20px; normal:标准空间,默认值。length:固定空间(长度值)。inherit:规定应该从父元素继承 word-spacing 属性的值。 // 字间距 定义字(字母)的标准空间、只对文字起作用 对于图片失效 letter-spacing: 20px; normal:,默认值。length:固定空间(长度值 // 行高 line-height: 20px; ...原创 2021-10-27 11:58:01 · 251 阅读 · 0 评论 -
微信小程序include和template引入
include引入 template引入 总结:include需要引入整个或大部分相同的页面布局建议使用 》》template重复的小模块多的话建议使用 注意:template不能直接引用被引用模块中引用的模块,只能引用被引用模块中申明的template,官方文档框架也有解释 https://developers.weixin.qq.com/miniprogram/dev/reference/wxml/import.html ...原创 2021-06-23 11:24:39 · 135 阅读 · 0 评论