示例
水平导航方向
使用布局容器top、bottom,将anchors放在顶部或者底部。
PCPhonePad
<page title="Anchors Horizontal">
<head>
<anchors data="{{anchors}}" placement="top" bindchanged="handleAnchorChanged"></anchors>
</head>
<module is-group>
<module title="基本信息" x="moduleBase" height="450px">
</module>
<module title="BOM结构" x="moduleBom" height="300px">
</module>
<module title="门店管控" x="moduleStoreControl" height="350px">
</module>
<module title="一品多价" x="moduleMorePrice" height="500px">
</module>
<module title="一品多包装" x="moduleMorePack" height="350px">
</module>
<module title="库存信息" x="moduleInventory" height="550px">
</module>
<module title="其他" x="moduleOthers" height="300px">
</module>
</module>
</page>
export default XPage({
data: {
anchors: [
{ title: "基本信息", href: "moduleBase" },
{ title: "BOM结构", href: "moduleBom" },
{ title: "门店管控", href: "moduleStoreControl" },
{ title: "一品多价", href: "moduleMorePrice" },
{ title: "一品多包装", href: "moduleMorePack" },
{ title: "库存信息", href: "moduleInventory" },
{ title: "其他", href: "moduleOthers" },
]
},
handleAnchorChanged(anchor) {
console.info('anchor changed', anchor);
},
});
垂直导航方向
设置module的width属性(1...12),使用栅格系统,将anchors放在右侧或者左侧。
PCPhonePad
<page title="Anchors Vertical">
<module is-group width="10">
<module title="基本信息" x="moduleBase" height="450px">
</module>
<module title="BOM结构" x="moduleBom" height="300px">
</module>
<module title="门店管控" x="moduleStoreControl" height="350px">
</module>
<module title="一品多价" x="moduleMorePrice" height="500px">
</module>
<module title="一品多包装" x="moduleMorePack" height="350px">
</module>
<module title="库存信息" x="moduleInventory" height="550px">
</module>
<module title="其他" x="moduleOthers" height="300px">
</module>
</module>
<module width="2">
<anchors data="{{anchors}}" placement="right" bindchanged="handleAnchorChanged"></anchors>
</module>
</page>
export default XPage({
data: {
anchors: [
{ title: "基本信息", href: "moduleBase" },
{ title: "BOM结构", href: "moduleBom" },
{ title: "门店管控", href: "moduleStoreControl" },
{ title: "一品多价", href: "moduleMorePrice" },
{ title: "一品多包装", href: "moduleMorePack" },
{ title: "库存信息", href: "moduleInventory" },
{ title: "其他", href: "moduleOthers" },
]
},
handleAnchorChanged(anchor) {
console.info('anchor changed', anchor);
},
});
Attributes
属性 | 说明 | 类型 | 可选值 | 默认值 | 端 | 版本 |
---|---|---|---|---|---|---|
placement | 锚的位置 | String | right/left/top/bottom | right | PC/Mobile | -- |
data | 锚的选项 | Array<{href: String, title: String}> | -- | -- | PC/Mobile | -- |
Events
名称 | 说明 | 回调参数 | 端 | 版本 |
---|---|---|---|---|
changed | 当前锚改变时触发 | ({href: String, title: String}) | PC/Mobile | -- |