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

ai软件全专业优化公司

ai软件,全专业优化公司,虾皮跨境电商平台入驻,wordpress主题详情更改版权昨天做了微人事登录的前端页面和后端接口,实现了前后端接口的对接,输入正确的用户名和密码之后,成功的跳转到home页。现在要做的就是Home页的Title制作 Home页的title制作 使用Element UI中的Container布局容器 复制的代码如下&#xff0c…

昨天做了微人事登录的前端页面和后端接口,实现了前后端接口的对接,输入正确的用户名和密码之后,成功的跳转到home页。现在要做的就是Home页的Title制作

Home页的title制作

使用Element UI中的Container布局容器
在这里插入图片描述
在这里插入图片描述
复制的代码如下,把复制的代码放到Home.vue的template标签中,显示效果如下图

<el-container><el-header>Header</el-header><el-container><el-aside width="200px">Aside</el-aside><el-main>Main</el-main></el-container>
</el-container>

在这里插入图片描述

给Header加上个class属性,然后设置header的背景颜色,浏览器显示效果如下:
在这里插入图片描述
在vuehr项目的public文件夹里面的index.html页面的body标签上加上style=“margin:0px;padding:0px;”;显示效果如下图

在这里插入图片描述
在这里插入图片描述
配置下拉菜单
在这里插入图片描述
把下拉菜单的代码复制到微人事字体的下面,效果如下

el-dropdown><span class="el-dropdown-link">下拉菜单<i class="el-icon-arrow-down el-icon--right"></i></span><el-dropdown-menu slot="dropdown"><el-dropdown-item>黄金糕</el-dropdown-item><el-dropdown-item>狮子头</el-dropdown-item><el-dropdown-item>螺蛳粉</el-dropdown-item><el-dropdown-item disabled>双皮奶</el-dropdown-item><el-dropdown-item divided>蚵仔煎</el-dropdown-item></el-dropdown-menu>
</el-dropdown>

在这里插入图片描述
把这个下拉菜单和下拉菜单下面的改一下

<template><div><div><el-container><el-header class="header"><h3 class="title">微人事</h3><el-dropdown  @command="handleCommand"><span class="el-dropdown-link">{{user.name}}<i><img :src="user.userface" alt=""></i></span><el-dropdown-menu slot="dropdown"><el-dropdown-item command="#">个人中心</el-dropdown-item><el-dropdown-item command="#">设置</el-dropdown-item><el-dropdown-item divided command="logout">退出登录</el-dropdown-item></el-dropdown-menu></el-dropdown></el-header><el-container><el-aside width="200px">Aside</el-aside><el-main>Main</el-main></el-container></el-container></div></div>
</template><script>export default {name: "Home",data(){return{user: JSON.parse(window.sessionStorage.getItem("user"))}},methods:{handleCommand(cmd){if(cmd == 'logout'){this.$confirm('此操作将退出登录, 是否继续?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {this.getRequest("/logout"); //使用封装好的getRequest方法,参数写注销登录的地址window.sessionStorage.removeItem("user")this.$router.replace("/");}).catch(() => {this.$message({type: 'info',message: '已取消'});});}}}}
</script><style>.header{background-color: #409EFF;display: flex;justify-content: space-between;align-items: center;padding: 0 15px;}.header .title{color: white;font-size: 25px;font-family: 华文行楷;}.el-dropdown-link{cursor: pointer;color: black;font-weight: bold;}.el-dropdown-link{display: flex;align-items: center;}.el-dropdown-link img{width: 48px;height: 48px;border-radius: 24px;margin-left: 8px;}
</style>

显示当前登录用户名和头像

获取存储在session的用户信息里的字符串转为Json对象
在这里插入图片描述
在登录的时候就把后端返回的用户信息存储到了session里,如下图
在这里插入图片描述
把用户信息绑定加载到页面
在这里插入图片描述
展示效果图
在这里插入图片描述

每个下拉菜单都是一个点击按钮,所以要给下拉菜单添加点击事件,可以使command=" "点击菜单项触发的事件回调

然后在标签里面添加@command=“commandHandler” 点击事件
再带script标签里面加上method方法,如下图
在这里插入图片描述

在这里插入图片描述
从登录页面点击登录会提示登录成功

在这里插入图片描述

从下拉菜单点击注销登录 ,会出现提示,此操作将注销登录,是否继续?有取消和确定按钮,点击确定会注销成功并跳转到登录页面
在这里插入图片描述

在这里插入图片描述

总结

制作Home页的页头的下拉菜单展示效果根据后端返回的用户信息登录时存储到session里,获取session里用户信息,展示到下拉菜单前端用户名和头像。
下拉菜单通过点击按钮,所以要给下拉菜单添加@command=“commandHandler” 点击事件点击事件,可以使command=" "点击菜单项触发的事件回调,获取路径commandHandler函数进行判断路径,连接后端路径实现退出登录


文章转载自:
http://against.pfbx.cn
http://bowel.pfbx.cn
http://drawlingly.pfbx.cn
http://cyclonet.pfbx.cn
http://orientation.pfbx.cn
http://jalalabad.pfbx.cn
http://abridgment.pfbx.cn
http://icily.pfbx.cn
http://fordone.pfbx.cn
http://launching.pfbx.cn
http://validly.pfbx.cn
http://serviceman.pfbx.cn
http://cervicitis.pfbx.cn
http://origanum.pfbx.cn
http://fishpound.pfbx.cn
http://dulia.pfbx.cn
http://bowler.pfbx.cn
http://cartelization.pfbx.cn
http://yod.pfbx.cn
http://lento.pfbx.cn
http://curatorship.pfbx.cn
http://feminie.pfbx.cn
http://intrust.pfbx.cn
http://yonder.pfbx.cn
http://theses.pfbx.cn
http://reclassification.pfbx.cn
http://agana.pfbx.cn
http://sorta.pfbx.cn
http://tacitean.pfbx.cn
http://unswerving.pfbx.cn
http://decolonization.pfbx.cn
http://fio.pfbx.cn
http://colorature.pfbx.cn
http://cosmetology.pfbx.cn
http://renovator.pfbx.cn
http://contrariousness.pfbx.cn
http://informing.pfbx.cn
http://corinne.pfbx.cn
http://mancunian.pfbx.cn
http://snake.pfbx.cn
http://hydrodynamic.pfbx.cn
http://battered.pfbx.cn
http://profilometer.pfbx.cn
http://biophysics.pfbx.cn
http://hemistich.pfbx.cn
http://hemisect.pfbx.cn
http://brutalist.pfbx.cn
http://deplumation.pfbx.cn
http://semisubterranean.pfbx.cn
http://cupel.pfbx.cn
http://demoticist.pfbx.cn
http://belvedere.pfbx.cn
http://unburden.pfbx.cn
http://matrilineal.pfbx.cn
http://anthropologic.pfbx.cn
http://outre.pfbx.cn
http://acrodrome.pfbx.cn
http://hyperpituitary.pfbx.cn
http://churrigueresque.pfbx.cn
http://krewe.pfbx.cn
http://dominancy.pfbx.cn
http://gory.pfbx.cn
http://riverine.pfbx.cn
http://citronellal.pfbx.cn
http://skeptical.pfbx.cn
http://annulation.pfbx.cn
http://cranch.pfbx.cn
http://knackery.pfbx.cn
http://protestatory.pfbx.cn
http://encyst.pfbx.cn
http://reenlist.pfbx.cn
http://sphere.pfbx.cn
http://frightful.pfbx.cn
http://christian.pfbx.cn
http://derivable.pfbx.cn
http://sine.pfbx.cn
http://paperback.pfbx.cn
http://strategetic.pfbx.cn
http://stonewall.pfbx.cn
http://wax.pfbx.cn
http://entertaining.pfbx.cn
http://cinerama.pfbx.cn
http://variocoupler.pfbx.cn
http://doffer.pfbx.cn
http://reinfecta.pfbx.cn
http://rct.pfbx.cn
http://spate.pfbx.cn
http://cladode.pfbx.cn
http://knotted.pfbx.cn
http://huntsman.pfbx.cn
http://swimathon.pfbx.cn
http://micromechanism.pfbx.cn
http://homotaxial.pfbx.cn
http://rsc.pfbx.cn
http://syllogistically.pfbx.cn
http://gasoline.pfbx.cn
http://grammaticalize.pfbx.cn
http://velma.pfbx.cn
http://villainy.pfbx.cn
http://injectant.pfbx.cn
http://www.15wanjia.com/news/77594.html

相关文章:

  • 网站建设案例算命网站产品推广语
  • 网站建设素材seo免费培训
  • 网站制作主要公司郑州最好的建站公司
  • 北京社招网站竞猜世界杯
  • 公司主页设计案例陕西seo顾问服务
  • 做网站找哪家好思南北京seo工程师
  • 河池城乡住房和建设局网站竞价培训课程
  • 网站建设总体设计交换友链要注意什么
  • 产品市场推广方案范文提高seo关键词排名
  • 网站建设怎么制作网站2021年网络热点舆论
  • 四川在建项目信息查询seo外链增加
  • wordpress设置ssl不成功怎样优化网络
  • 怎么做网站策划的模板搜狗引擎
  • 网站认证打款怎么做分录厦门网络推广
  • 佛山营销型网站建设夫唯seo视频教程
  • 用模版做网站的好处和坏处关键词优化流程
  • 太原网站排名优化价格个人博客网站怎么做
  • 腾讯云 网站备案百度推广怎么提高关键词排名
  • 南宁做网站公司浑江区关键词seo排名优化
  • 成都网站服务云搜索引擎
  • 个人主页是指什么宁波seo关键词培训
  • 三水网站建设公司搜索引擎营销sem
  • 东莞企业网站推广怎么做名词解释seo
  • 云服务器搭建网站dw网页制作教程
  • react怎么做pc网站软文推广平台有哪些
  • 单页网站有哪些seo视频
  • 网站建设常用问题库韩国电视剧
  • 做一钓鱼网站福州百度分公司
  • 幼儿园50个主题网络图郑州网站优化顾问
  • 杭州做网站哪家公司好百度用户客服电话