vue+leancloud+element-ui新手坑合集

新项目启动,顺便记录下一些坑,很多都是没有仔细查阅文档或者文档说明不清造成的(对新手而言)

使用leancloud javascript sdk需要用catch取error信息
...then(...).catch(function (error) {
  console.log(error.code, error.message)
})
element-ui el-input 增加键盘响应需要加native
@keyup.enter.native='action'
vue-router 子组件默认path为空,路径不能有/
children: [
  {
    path: '',
    componet: xxx
  }
]
element el-input 数字验证的时候需要去掉 trigger
rule: {
  { required: true, message: '请输入' },
  { type: 'number', message: '必须是数字' }
}

leancloud 最坑的number类型查询

默认值只对设置后新插入的对象才有效,对于老对象只是查询后加入默认值的假象。
因此如果根据默认值查询,请使用 nurseType = 0 or nurseType is not exists 两个条件组合查询。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容