【整理篇】微信小程序开发注意事项

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yechaoa/article/details/88029491

以前的笔记。

1.wx.navigateTo 和 wx.redirectTo 不允许跳转到 tabbar 页面,只能用 wx.switchTab 跳转到 tabbar 页面


2.项目根目录下的app.json文件中的pages,第一个路径就是默认启动最先打开的页面


3.编辑器左下角有当前页面路径,可 复制/打开


4.我们通常会在事件中获取数据,e.target.currentTarget.text:获取当前控件中的参数,如果是子view中的参数:e.target.target.text


5.使用系统的util.js文件需要在要使用的js页面导入var util = require(’…/…/utils/util.js’);

使用: var date = util.formatDate(new Date());
自定义的util方法需要在module.exports = { }方法中 暴露给其他类使用

6.POST请求

header: {
‘content-type’: ‘application/x-www-form-urlencoded’
},

7.“errcode”:40029

appid出现问题,检查前后台是否一致,或者重新创建一下项目
以及检查一下后台的APPID和AppSecre的参数配置

8. “errcode”: 48001

小程序没有授权


#### 9..json文件中 不能有注释,否则编译不通过

10.修改键盘回车键

confirm-type 有效值:

  • send 右下角按钮为“发送”
  • search 右下角按钮为“搜索”
  • next 右下角按钮为“下一个”
  • go 右下角按钮为“前往”
  • done 右下角按钮为“完成”

11.去掉滚动条

  • 方式一
::-webkit-scrollbar {
     width: 0;
     height: 0;
     color: transparent;
}
  • 方式二
::-webkit-scrollbar {
     display: none;
}

12.给文字加横线

css:

text-decoration:line-through;

后续整理再加。


小程序开发专栏:https://blog.csdn.net/yechaoa/column/info/28428


猜你喜欢

转载自blog.csdn.net/yechaoa/article/details/88029491