1.用ray写法,global.config.ts里配置
usingComponents: {
'nav-bar': './pages/Nav/index',
}
pages/Nav/index.json配置了
{
"component": true
}
编译会报错.想在小程序页面全局应用的自定义导航栏应该怎么设置呢?
2.global.config.ts下window的custom: true作用是什么?
custom: true 的作用是不使用系统的默认导航栏,使用业务自定义的。
如果在 Ray 里面希望自定义业务导航栏可以参考这个基础的 SDM 模板,
在global.config.ts custom: true不生效,只有在页面config.ts或者global.config.ts配置了navigationStyle: 'custom'才行
使用smartUI的NavBar封装了一个自定义导航栏,怎么结合global.config.ts里的usingComponents呢?
不需要用usingComponents 直接在需要用到这个组件的地方引入即可
import { NavBar } from '@ray-js/smart-ui'
NavBar 使用 SmartUI之后就完全脱离小程序的头部配置功能了 都需要你自己去根据SmartUI NavBar 修改和实现