1.边框属于view里面的长度--  box-sizing:border-box;

2.在image中设置背景图,让另一个view的z-index:1;

3.view中的image水平垂直居中,需要配合display:flex使用,(加了width会导致不能最右)

3-1.水平居中--justify-content:center 

3.2.垂直居中--align-items:center

4.页面加载依次 onLoad--onShow--onReady

4.1 重定向redirectTo会触发当前页面的onUnload方法,然后是页面的加载顺序。

4.2 跳到navigateTo触发onHide方法,然后是页面的加载顺序。

4.3 navigateBack返回是onUnload方法,然后新页面的onShow方法。

 5.textarea的长度随着输入文字的长度变长,在wxml中加上auto-height='true'(也有说要加上fixed='true'和contenteditable='true' 实际上加了没加都一样)

6.去掉默认的button样式 button::after{border:none}

7.文本省略号三要素  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;(加上元素限制的长度width,还不行需要在父级框中加上display:flex,终极大招在当前view加display:inline)

8.图片和文本之间有距离,图片属性加上display:flex;

9.三元运算符,取值的时候"{{cantap?'method1':'method2'}}"

10.循环的position:absolute位置的元素,如果设置了top或者bottom则会重叠在一个位置。可以用position:relative;代替

11.vant-app 组件绑定事件,bind:event=""

posted on 2019-05-09 11:45  SuperTan  阅读(263)  评论(0编辑  收藏  举报