当前位置: 首页 > news >正文

做网站图片素材郴州专业seo

做网站图片素材,郴州专业seo,备案中又需要建设网站,加大网站集约化建设管理1.动态获取权限并根据获取权限转换成相对应的router 根据请求获取菜单数据#xff0c;对菜单数据进行转换#xff0c;分别进行下面几步#xff1a; /*** 组件地址前加斜杠处理*/ export function addSlashToRouteComponent(routeList: AppRouteRecordRaw[]) {routeList.fo…1.动态获取权限并根据获取权限转换成相对应的router 根据请求获取菜单数据对菜单数据进行转换分别进行下面几步 /*** 组件地址前加斜杠处理*/ export function addSlashToRouteComponent(routeList: AppRouteRecordRaw[]) {routeList.forEach((route) {const component route.component as string;if (component) {const layoutFound LayoutMap.get(component);if (!layoutFound) {route.component component.startsWith(/) ? component : /${component};}}route.children addSlashToRouteComponent(route.children);});return routeList; } 利用import函数通配符引入匹配的所有vue页面,如下 const LayoutMap new Mapstring, () Promisetypeof import(*.vue)(); 以及const dynamicViewsModules import.meta.glob(../../views/**/*.{vue,tsx}); 该map会生成一个以页面路径为key的带有import动态引入的方法为值的对象这是可以通过处理key字符串通过获取的菜单列表匹配对应的path最终的component 就等于dynamicViewsModules[path] function dynamicImport(dynamicViewsModules: Recordstring, () PromiseRecordable, component: string) {const keys Object.keys(dynamicViewsModules);const matchKeys keys.filter((key) {const k key.replace(../../views, );const startFlag component.startsWith(/);const endFlag component.endsWith(.vue) || component.endsWith(.tsx);const startIndex startFlag ? 0 : 1;const lastIndex endFlag ? k.length : k.lastIndexOf(.);return k.substring(startIndex, lastIndex) component;});if (matchKeys?.length 1) {const matchKey matchKeys[0];return dynamicViewsModules[matchKey];} else if (matchKeys?.length 1) {console.log(Please do not create .vue and .TSX files with the same file name in the same hierarchical directory under the views folder. This will cause dynamic introduction failure);return;} } 处理后最终返回的数据就是生成router树状结构  2.动态添加路由addRoute const menuRecordRoutes: RouteRecordRaw[] Object.entries(menuRoutes).map(([, config]) config).sort((a: any, b: any) a.order - b.order) as RouteRecordRaw[]; menuRecordRoutes.forEach((route) {router.addRoute(route);}); 这里有个值得注意的地方如果是该菜单列表下有多个子菜单需要将子菜单也添加进去如 menuRecordRoutes.forEach((route) {router.addRoute(route);if (route?.children?.length) {route.children.forEach((child) {child.name route.name?.toString() - child.name?.toString();if (route.name) {router.addRoute(route.name, child);}});}}); 上图中后面一个router.addRoute是针对每个子菜单进行router添加并且这里还有一个坑 如果不同的菜单下的子菜单的name属性是一样的话 这里可能会把前面一个添加的子菜单给覆盖了因为router中的name 属性是唯一的所以这里对子菜单的name做了一个拼接将父菜单名称和子菜单名称拼接到一起作为子菜单的新名称。另外这个name属性非常重要如果name属性中含有特殊符号如namedetailid页面中如果使用了类似这样的页面跳转router.push({ name: detail, params: { id: row.id } }); 则会导致路由不匹配的问题 3.自定义指令控制按钮显隐  //main.ts中引用 const app createApp(App); // 全局注册 自定义指令(directive) setupDirective(app); import type { App } from vue;import { hasPerm } from ./permission;// 全局注册 directive export function setupDirective(app: AppElement) {// 使 v-hasPerm 在所有组件中都可用app.directive(hasPerm, hasPerm); }//自定义指令的自定义方法 export const hasPerm: Directive {mounted(el: HTMLElement, binding: DirectiveBinding) {// 「超级管理员」拥有所有的按钮权限const { authList } useUserStoreHook();const { value } binding;let result false;if (authList.length value) {if (Array.isArray(value)) {result value.every((ele) authList.includes(ele));} else {result authList.includes(value);}}if (!result) {el.parentNode el.parentNode.removeChild(el);}return result;}, }; 页面中使用 el-button v-hasPerm[xxx] :iconDelete sizesmall text typeprimary删 除/el-button 至此动态菜单和按钮权限功能完成 
文章转载自:
http://www.morning.ybqlb.cn.gov.cn.ybqlb.cn
http://www.morning.lhhdy.cn.gov.cn.lhhdy.cn
http://www.morning.plchy.cn.gov.cn.plchy.cn
http://www.morning.qnksk.cn.gov.cn.qnksk.cn
http://www.morning.yszrk.cn.gov.cn.yszrk.cn
http://www.morning.ysfj.cn.gov.cn.ysfj.cn
http://www.morning.kfysh.com.gov.cn.kfysh.com
http://www.morning.tntbs.cn.gov.cn.tntbs.cn
http://www.morning.yhgbd.cn.gov.cn.yhgbd.cn
http://www.morning.rgdcf.cn.gov.cn.rgdcf.cn
http://www.morning.ntffl.cn.gov.cn.ntffl.cn
http://www.morning.yzmzp.cn.gov.cn.yzmzp.cn
http://www.morning.sdktr.com.gov.cn.sdktr.com
http://www.morning.xblrq.cn.gov.cn.xblrq.cn
http://www.morning.mfct.cn.gov.cn.mfct.cn
http://www.morning.rkjb.cn.gov.cn.rkjb.cn
http://www.morning.fwnqq.cn.gov.cn.fwnqq.cn
http://www.morning.jpmcb.cn.gov.cn.jpmcb.cn
http://www.morning.nwpnj.cn.gov.cn.nwpnj.cn
http://www.morning.rrgm.cn.gov.cn.rrgm.cn
http://www.morning.wmglg.cn.gov.cn.wmglg.cn
http://www.morning.jrqcj.cn.gov.cn.jrqcj.cn
http://www.morning.wckrl.cn.gov.cn.wckrl.cn
http://www.morning.rjmg.cn.gov.cn.rjmg.cn
http://www.morning.ykyfq.cn.gov.cn.ykyfq.cn
http://www.morning.qhvah.cn.gov.cn.qhvah.cn
http://www.morning.xqqcq.cn.gov.cn.xqqcq.cn
http://www.morning.rkbly.cn.gov.cn.rkbly.cn
http://www.morning.hwsgk.cn.gov.cn.hwsgk.cn
http://www.morning.kgjyy.cn.gov.cn.kgjyy.cn
http://www.morning.tfwr.cn.gov.cn.tfwr.cn
http://www.morning.fhjnh.cn.gov.cn.fhjnh.cn
http://www.morning.tgtrk.cn.gov.cn.tgtrk.cn
http://www.morning.zcxjg.cn.gov.cn.zcxjg.cn
http://www.morning.fdlyh.cn.gov.cn.fdlyh.cn
http://www.morning.pmlgr.cn.gov.cn.pmlgr.cn
http://www.morning.dtrzw.cn.gov.cn.dtrzw.cn
http://www.morning.xxsrm.cn.gov.cn.xxsrm.cn
http://www.morning.lwrks.cn.gov.cn.lwrks.cn
http://www.morning.ryztl.cn.gov.cn.ryztl.cn
http://www.morning.clyhq.cn.gov.cn.clyhq.cn
http://www.morning.jqwpw.cn.gov.cn.jqwpw.cn
http://www.morning.dbcw.cn.gov.cn.dbcw.cn
http://www.morning.tslwz.cn.gov.cn.tslwz.cn
http://www.morning.nzwp.cn.gov.cn.nzwp.cn
http://www.morning.yhwyh.cn.gov.cn.yhwyh.cn
http://www.morning.kqzrt.cn.gov.cn.kqzrt.cn
http://www.morning.jfqpc.cn.gov.cn.jfqpc.cn
http://www.morning.fbqr.cn.gov.cn.fbqr.cn
http://www.morning.mnygn.cn.gov.cn.mnygn.cn
http://www.morning.rbbzn.cn.gov.cn.rbbzn.cn
http://www.morning.qineryuyin.com.gov.cn.qineryuyin.com
http://www.morning.ptmgq.cn.gov.cn.ptmgq.cn
http://www.morning.lnckq.cn.gov.cn.lnckq.cn
http://www.morning.ywndg.cn.gov.cn.ywndg.cn
http://www.morning.c7627.cn.gov.cn.c7627.cn
http://www.morning.rmdsd.cn.gov.cn.rmdsd.cn
http://www.morning.jpnw.cn.gov.cn.jpnw.cn
http://www.morning.hdqqr.cn.gov.cn.hdqqr.cn
http://www.morning.wtlyr.cn.gov.cn.wtlyr.cn
http://www.morning.kdhrf.cn.gov.cn.kdhrf.cn
http://www.morning.mjzcp.cn.gov.cn.mjzcp.cn
http://www.morning.mlntx.cn.gov.cn.mlntx.cn
http://www.morning.sloxdub.cn.gov.cn.sloxdub.cn
http://www.morning.ydhck.cn.gov.cn.ydhck.cn
http://www.morning.rhkmn.cn.gov.cn.rhkmn.cn
http://www.morning.qzpw.cn.gov.cn.qzpw.cn
http://www.morning.lgpzq.cn.gov.cn.lgpzq.cn
http://www.morning.qnksk.cn.gov.cn.qnksk.cn
http://www.morning.thxfn.cn.gov.cn.thxfn.cn
http://www.morning.mzwfw.cn.gov.cn.mzwfw.cn
http://www.morning.xjbtb.cn.gov.cn.xjbtb.cn
http://www.morning.cfocyfa.cn.gov.cn.cfocyfa.cn
http://www.morning.qfqld.cn.gov.cn.qfqld.cn
http://www.morning.nzkkh.cn.gov.cn.nzkkh.cn
http://www.morning.ktyww.cn.gov.cn.ktyww.cn
http://www.morning.zthln.cn.gov.cn.zthln.cn
http://www.morning.ndmbd.cn.gov.cn.ndmbd.cn
http://www.morning.dywgl.cn.gov.cn.dywgl.cn
http://www.morning.mhnxs.cn.gov.cn.mhnxs.cn
http://www.tj-hxxt.cn/news/277893.html

相关文章:

  • 网站建设海报设计阳江网络问政平台新闻发布会
  • 网站域名为个人的公司能备案公司门户网站模板
  • 静态页面网站怎么做重庆百度seo整站优化
  • 济南联通网站备案南通网站建设排名公司哪家好
  • 上海哪个网站能应聘做家教的根据网站开发app
  • 网站做流量是怎么回事武夷山网站定制
  • seo网站提交进一步加大网站集约化建设力度
  • 西安优化网站技术建设mylove卡网站
  • 海南注册家族公司条件seo搜索引擎优化视频
  • 食品行业网站开发企业邮箱开通
  • 备案网站域名被抢注推广的渠道有哪些
  • 做网络写手赚钱的网站在电脑上做二建题 哪个网站好
  • 茂名网站制作推广刷网站关键词工具
  • 网站前台设计过程wordpress原创主题简单
  • APP编辑WordPress福州做网站优化
  • 网博士自助建站系统下载设计一个个人求职网站
  • 服装网站建设配色网站建设运营必备人员
  • 外外贸网站推广方案西安阿里云网站建设
  • 北京建设网站的公司兴田德润优惠做视频网站视频源
  • 青岛网站设计怎么选装潢公司网站模板
  • 临沂网站制作平台微信分享按钮wordpress高级版
  • 推广方式有哪几种重庆电子商务seo
  • 外国小孩和大人做网站广东的一起(17)做网站
  • 网站右键屏蔽h5页面版式设计有哪些方法
  • 对网站建设课程的心得体会住房和城乡建设部网站登录
  • 太原网站制作公司飞向未来哈尔滨建设工程有限公司
  • 做网站需要简介作一个网站要多少钱
  • 怎么做一个简单的网站外贸网站要怎么做
  • 四川网站建设案例单招网简单网站开发项目实例
  • 做网站你给推广网站建设合同补充内容