说明
最近想做一个vue商城小项目,练习一下vue的语法,刚刚好碰到了需要左右菜单实现联动,因此就接触了 better-scroll。
代码
页面结构以及数据
//页面结构
:class="{active: currentIndex === index}"
@click="selectLeft(index)" ref="lItem">{ { item}}
{ { items.name}}
{ { item}}
//数据
export default {
data(){
return {
goodMenu: ['菜单1', '菜单2','菜单3', '菜单4', '菜单5', '菜单6', '菜单7', '菜单8'],
goodList: [
{ name: '菜单1', data: ['1.1', '1.2', '1.3', '1.4', '1.5']},
{ name: '菜单2', data: ['1.1