博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vue 自定义 移动端筛选条件
阅读量:6250 次
发布时间:2019-06-22

本文共 5714 字,大约阅读时间需要 19 分钟。

1.创建组件

components/FilterBar/FilterBar.vue

components/FilterBar/FilterBarPop.vue

2.页面调用

pages/FilterBarTest

data.js

export default [{  name: '附近',  icon: '',  value: 'area',  showTabHeader: true,  defaultIcon: '',  selectIcon: '',  selectIndex: 0,  tabs: [    {      icon: '',      name: '商圈',      selectIndex: 0,      detailList: [        {          name: '附近',          icon: '',          selectIndex: 0,          list: [{            name: '默认',            value: 'all'          }, {            name: '500米',            value: '500'          }, {            name: '1000米',            value: '1000'          }]        },        {          name: '朝阳区',          icon: '',          selectIndex: 1,          list: [{            name: '全部',            value: 'all'          }, {            name: '建国门',            value: 'jianguomen'          }, {            name: '亚运村',            value: 'yayuncun'          }]        },        {          name: '海淀区',          icon: '',          selectIndex: 2,          list: [{            name: '全部',            value: 'all'          }, {            name: '中关村',            value: 'zhongguancun'          }, {            name: '五道口',            value: 'wudaokou'          }]        }      ]    },    {      icon: '',      name: '地铁沿线',      selectIndex: 1,      detailList: [        {          name: '1号线',          icon: '',          selectIndex: 0,          list: [{            name: '平果圆',            value: 'pingguoyuan'          }, {            name: '古城',            value: 'gucheng'          }, {            name: '八角游乐园',            value: 'bajiaoyouleyuan'          }]        },        {          name: '2号线',          icon: '',          selectIndex: 1,          list: [{            name: '积水潭',            value: 'jishuitan'          }, {            name: '鼓楼大街',            value: 'guloudajie'          }, {            name: '安定门',            value: 'andingmen'          }]        },        {          name: '4号线',          icon: '',          selectIndex: 2,          list: [{            name: '安和桥北',            value: 'anheqiaobei'          }, {            name: '北宫门',            value: 'beigongmen'          }, {            name: '西宛',            value: 'xiwan'          }]        }      ]    }  ]},{  name: '菜系',  icon: '',  value: 'food',  showTabHeader: false,  defaultIcon: '',  selectIcon: '',  selectIndex: 0,  tabs: [    {      icon: '',      name: '',      selectIndex: 0,      detailList: [        {          name: '全部',          icon: '',          value: '全部',          selectIndex: 0,          list: [{            name: "全部",            value: 'all'          }]        },        {          name: '中餐馆',          icon: '',          value: '中餐馆',          selectIndex: 1,          list: [{            name: '全部',            value: 'all'          }, {            name: '火锅',            value: 'hot pot'          }, {            name: '川菜',            value: 'Sichuan cuisine'          }]        },        {          name: '西餐馆',          icon: '',          value: '西餐管',          selectIndex: 2,          list: [{            name: '全部',            value: 'all'          }, {            name: '披萨',            value: 'pizza'          }, {            name: '牛排',            value: 'steak'          }]        }      ]    }  ]},{  name: '排序',  icon: '',  value: 'compositor',  showTabHeader: false,  defaultIcon: '',  selectIcon: '',  selectIndex: 0,  tabs: [    {      icon: '',      name: '',      selectIndex: 0,      detailList: [        {          name: '只能排序',          icon: '',          value: '0',          selectIndex: 0        },        {          name: '离我最近',          icon: '',          value: '1',          selectIndex: 1        },        {          name: '评价最好',          icon: '',          value: '2',          selectIndex: 2        }      ]    }  ]},{  name: '筛选',  icon: '',  value: 'filter',  type: 'filter',  showTabHeader: false,  defaultIcon: '',  selectIcon: '',  selectIndex: 0,  tabs: [    {      icon: '',      name: '价格',      selectIndex: 0,      detailList: [        {          name: '0-50',          value: '0-50',          selectIndex: -1        },        {          name: '50-100',          value: '50-100',          selectIndex: -1        },        {          name: '100-150',          value: '100-150',          selectIndex: -1        },        {          name: '150-200',          value: '150-200',          selectIndex: -1        },        {          name: '200-250',          value: '200-250',          selectIndex: -1        },        {          name: '300-350',          value: '300-350',          selectIndex: -1        }      ]    },{      icon: '',      name: '入住类型',      selectIndex: 1,      detailList: [        {          name: '不限',          value: 'all',          selectIndex: -1        }, {            name: '全日房',            value: 'daily',            selectIndex: -1        }, {            name: '钟点房',            value: 'time',            selectIndex: -1        },        {          name: '支持团购',          value: 'group buy',          selectIndex: -1        }      ]    }  ]}]

3.效果图

  

.

转载于:https://www.cnblogs.com/crazycode2/p/8849448.html

你可能感兴趣的文章
预科班第四次考核总结
查看>>
【js】再谈移动端的模态框实现
查看>>
html
查看>>
Java变量类型
查看>>
[leetcode-89-Gray Code]
查看>>
mysql 存储过程的基本语法知识
查看>>
数据分析师到底在做什么?
查看>>
pt-heartbeat工具监控MySQL复制延迟
查看>>
指尖下的js —— 多触式web前端开发之三:处理复杂手势(转)
查看>>
spring boot项目配置文件集合
查看>>
cube-ui的用法
查看>>
2015.4.21 SetWindowPos函数用法
查看>>
2011-12-14 调用cmd并获得输入输出+网络访问
查看>>
解决nim db_mysql could not load: libmysql.dll的问题
查看>>
JavaScript之再谈回调与闭包
查看>>
优化PHP代码的一些建议
查看>>
android学习网站
查看>>
TCP定时器详解
查看>>
if判断,switch语句
查看>>
postgresql中字段为空的查询
查看>>