@qiaobaBoss
2022-08-31T15:55:20.000000Z
字数 917
阅读 208
H5技术 Udesk
//错误 --<script>import LookUpOwner from "@/uni_modules/udesk-case/special-pages/look-up/look-up-owner/look-up-owner.nvue";export default LookUpOwner;</script>//修正 --<template><view><look-up-owner></look-up-owner></view></template><script>import LookUpOwner from "@/uni_modules/udesk-case/special-pages/look-up/look-up-owner/look-up-owner.nvue";export default {components: {"look-up-owner": LookUpOwner}}</script>
style-class
页面路径 不要写:window.location.pathname 用 getCurrentPages().at(-1).route;
Window API 不要uni提供的window相关API,如:uni.getRightWindowStyle()
js for in 下标变量要加 let 声明,不要直接 for(mode in items){}
取页面参数 this.options在小程序取不到参数, 要在onload或mounted尽量在 接收 options。 onload 会在created之后。
页面初始化接口调用 页面的初始化接口在onload或mounted里面调用,不要在created里用
子组件参数传递 小程序对模版写法兼容没那么好,不要在模版上给子组件绑定未在data里面声明的属性。太恶劣了,不明白h5为啥会生效。