computed:初始化计算按钮宽度
del:删除菜单
addBtn:添加一级菜单
subAddBtn:添加子菜单
menuTab:点击一级菜单
liTab:点击子菜单
updateValue:更新按钮name
updateUrl:更新按钮url
getInfo:显示name,url
setmenu:设置一级菜单信息
setSubmenu:设置子菜单信息
urlWindow:显示右侧url窗口
save:保存按钮
init() { //获取数据
var $this = this;
$this.$httpService.getMenuDate().then((res) => {
if (res.code == '2000') {
this.button = res.data;
}
}).catch((err) => {
Toast({
duration: 1500,
message: err.message
});
Indicator.close();
});
},
save() { //保存数据
let button = this.button;
//ajax保存至后台
let params = {
buttonJson: JSON.stringify(button),
};
//console.log(JSON.stringify(button));
this.$httpService.createMenu(params).then((res) => {
if (res.code == 2000) {
Toast({
duration: 1500,
message: '保存成功'
});
Indicator.close();
}
})
}