We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问,异步加载菜单的方法里面该如何引入ajax请求后端菜单? 使用文档中推荐的三种方式,都会报错,只能使用在class上面?
The text was updated successfully, but these errors were encountered:
参考代码如下:
import {sxAjax} from '@/commons/ajax'; /* * 菜单数据 返回Promise各式,支持前端硬编码、异步获取菜单数据 * */ export default function getMenus() { return sxAjax.get('/menus') .then(res => { const menus = []; if (res && res.length) { res.forEach(item => { let {id: key, parentId: parentKey, name: text, order, url: path} = item; const isParent = !!res.find(item => item.parentId === key); order = window.parseInt(order) || 0; menus.push({ key: `${key}`, parentKey: `${parentKey}`, text, path, order, icon: isParent ? 'folder' : 'file-text', }); }); } return menus; }); }
Sorry, something went wrong.
No branches or pull requests
请问,异步加载菜单的方法里面该如何引入ajax请求后端菜单?
使用文档中推荐的三种方式,都会报错,只能使用在class上面?
The text was updated successfully, but these errors were encountered: