公共底部菜单
默认用法(图标+文字)
<nut-footercom :menuList='footerMenuList' @changeMenuFn="changeMenuFn"></nut-footercom>//配置数据footerMenuList 数组长度支持2到4个子对象,具体看下方使用须知
//配置数据每一项为
{
iconselect: "http://img13.360buyimg.com/uba/jfs/t27010/39/1558743/896/9e3c3096/5b7fc73dN636e01f4.png",
icon:"http://img20.360buyimg.com/uba/jfs/t24202/290/2428485933/1010/db808515/5b7fc6afN8d31330b.png",
url: "/orderDetail",
text:'首页'
}
仅显示图标
<nut-footercom :menuList='footerMenuList' @changeMenuFn="changeMenuFn"></nut-footercom>
//配置数据每一项为
{
iconselect: "http://img13.360buyimg.com/uba/jfs/t27010/39/1558743/896/9e3c3096/5b7fc73dN636e01f4.png",
icon:"http://img20.360buyimg.com/uba/jfs/t24202/290/2428485933/1010/db808515/5b7fc6afN8d31330b.png",
url: "/orderDetail"
}
使用须知与通用数据代码和回调示例
//菜单图标文案 数组对象 使用须知:
// 1, 数组内对象可用属性共有: iconselect(选中图标) icon(默认图标) url(跳转地址) text(文案)
// 2, text(文案) 要配置请全部配置。
// 3, url(跳转地址) 不配置则不做跳转
// 4, iconselect(选中图标) icon(默认图标) 为必选属性
export default {
data() {
return {
footerMenuList:[
{
iconselect:
"http://img13.360buyimg.com/uba/jfs/t27010/39/1558743/896/9e3c3096/5b7fc73dN636e01f4.png",
icon:
"http://img20.360buyimg.com/uba/jfs/t24202/290/2428485933/1010/db808515/5b7fc6afN8d31330b.png",
url: "/orderDetail",
text:'首页'
},
{
iconselect:
"http://img13.360buyimg.com/uba/jfs/t27010/39/1558743/896/9e3c3096/5b7fc73dN636e01f4.png",
icon:
"http://img20.360buyimg.com/uba/jfs/t24202/290/2428485933/1010/db808515/5b7fc6afN8d31330b.png",
url: "/orderDetail",
text:'测试1'
},
{
iconselect:
"http://img13.360buyimg.com/uba/jfs/t27010/39/1558743/896/9e3c3096/5b7fc73dN636e01f4.png",
icon:
"http://img20.360buyimg.com/uba/jfs/t24202/290/2428485933/1010/db808515/5b7fc6afN8d31330b.png",
url: "/orderDetail",
text:'测试2'
},
{
iconselect:
"http://img12.360buyimg.com/uba/jfs/t26998/32/1861936/1307/776501d8/5b7fc73dNf725ab6d.png",
icon:
"http://img13.360buyimg.com/uba/jfs/t22762/195/2428374466/1450/70f02b6/5b7fc73dN45d94c02.png",
text:'测试3'
}
]
}
},
methods: {
changeMenuFn(item) {
console.log(item)
},
}
}
Props
参数 | 说明 | 类型 | 默认值 | 可选值 |
---|
footerMenuList | 菜单图标文案数组配置请参考上方注释 | Array | 如图所见选中前后的icon和文字(文字可不配置) | — |
Events
事件名 | 说明 | 回调参数 |
---|
changeMenuFn | 当点击某个菜单时触发 | 被点击菜单的数据对象 |