vue实现a标签点击高亮方法

前端之家收集整理的这篇文章主要介绍了vue实现a标签点击高亮方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如下所示:

@H_<a href="https://www.jb51.cc/tag/301/" target="_blank" class="keywords">301</a>_7@ <<a href="https://www.jb51.cc/tag/Meta/" target="_blank" class="keywords">Meta</a> charset="UTF-8"> <<a href="https://www.jb51.cc/tag/Meta/" target="_blank" class="keywords">Meta</a> name="viewport" content="width=device-width,initial-scale=1"> <!--<link href="css/style.css" rel="external nofollow" rel="stylesheet">--> <script src="js/jquery.js"></script> <script src="js/vue(2.0).js"></script> <style lang="less" rel="stylesheet/less"> .a { display: block; float: left; margin-left: 20px; } .active { color: red; font-size: 17px; } </style> </head> <body> <div id="app"> <a class="s-bt" @click="selected(Aname.name)" :class="{active: active == Aname.name}" v-for="Aname in Alist">{{Aname.name}}</a> </div> <script> new Vue({ el: '#app',data: { Alist: [{ name: '影视大咖' },{ name: '女明星' },{ name: '男明星' },{ name: '商业大亨' }],active: '' },mounted() { },methods: { selected(name) { this.active = name; } } }) </script> </body> </html></pre> </div> <p>以上这篇vue实现a<a href="https://www.jb51.cc/tag/biaoqian/" target="_blank" class="keywords">标签</a>点击高亮<a href="https://www.jb51.cc/tag/fangfa/" target="_blank" class="keywords">方法</a>就是小编<a href="https://www.jb51.cc/tag/fenxiang/" target="_blank" class="keywords">分享</a>给大家的全部<a href="https://www.jb51.cc/tag/neirong/" target="_blank" class="keywords">内容</a>了,希望能给大家一个参考,也希望大家多多<a href="https://www.jb51.cc/tag/zhichi/" target="_blank" class="keywords">支持</a>编程之家。</p><i class="glyphicon glyphicon-link"></i> 原文链接:https://www.f2er.com/vue/33141.html</div> <div class="topcard-tags"><a href="https://www.f2er.com/tag/vue/" class="tag_link" target="_blank">vue</a><a href="https://www.f2er.com/tag/pvue/" class="tag_link" target="_blank">vue</a><a href="https://www.f2er.com/tag/vuep/" class="tag_link" target="_blank">vue</a><a href="https://www.f2er.com/tag/dianjigaoliang/" class="tag_link" target="_blank">点击高亮</a></div> <ul class="list-group"> <li class="list-group-item"><a href="https://www.f2er.com/vue/33142.html" title="Vue-路由导航菜单栏的高亮设置方法">上一篇:Vue-路由导航菜单栏的高亮设置方法</a><a href="https://www.f2er.com/vue/33140.html" title="vue结合Echarts实现点击高亮效果的示例" class="text-muted pull-right">下一篇:vue结合Echarts实现点击高亮效果的</a> </li> </ul> </div> </div> </div> <!-- row end --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-4605373693034661" data-ad-slot="9144498553"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div> </div> </div> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <div class="title"><h1>猜你在找的Vue相关文章</h1></div> <div class="list_con"> <a href="https://www.f2er.com/vue/997429.html" title="elementui的el-tree第一次加载无法展开和选中的问题"><div class="title">elementui的el-tree第一次加载无法展开和选中的问题</div> <div class="summary">问题现象 elmentui的el-tree数据加载问题,导致第一次加载选中当前节点和高亮当前节点没有...</div> <time class="summary">作者:前端之家 时间:2021-02-17</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/997428.html" title="VSCODE打开一个文件,另一个文件就关闭的问题的解决方法"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/02-17/21/9e2e32f4ad7f00fdffa540c0f7d918e1.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">VSCODE打开一个文件,另一个文件就关闭的问题的解决方法</div> <div class="summary">因为刚打开文件,vscode默认是预览状态,如果编辑过之后,就不会有这个问题。 可以通过双击...</div> <time class="summary">作者:前端之家 时间:2021-02-17</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/997427.html" title="一文带你学会国产加密算法SM4的vue实现方案"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/02-17/21/29a0275a80b1fac147aa687624a9bfe1.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">一文带你学会国产加密算法SM4的vue实现方案</div> <div class="summary">前言 上篇文章我们介绍了国产SM4加密算法的后端java实现方案。没有看过的小伙伴可以看一下...</div> <time class="summary">作者:前端之家 时间:2021-02-17</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/997426.html" title="解决vue报错:Module build failed (from ./node_modules/_eslint-loader@2.2.1@eslint-loader/index.js): TypeError: Cannot read property 'range' of null"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/02-17/21/ac433ae643be89ef37b127b24fa2a61a.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">解决vue报错:Module build failed (from ./node_modules/_eslint-loader@2.2.1@eslint-loader/index.js): TypeError: Cannot read property 'range' of null</div> <div class="summary">在项目中引入动态路由时报错 写法: 报错: Module build failed (from ./node_modules/_esl...</div> <time class="summary">作者:前端之家 时间:2021-02-17</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/997425.html" title="vue中解决Uncaught ReferenceError: regeneratorRuntime is not defined问题"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/02-17/21/9f2045768979b899c69e66354a1f62d0.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">vue中解决Uncaught ReferenceError: regeneratorRuntime is not defined问题</div> <div class="summary">问题产生 在使用babel编译es6时,遇到报错Uncaught ReferenceError: regeneratorRuntime i...</div> <time class="summary">作者:前端之家 时间:2021-02-17</time> </a> </div> <div style="border-bottom: 1px solid #f4f4f4;margin-top:20px;"> <ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-fr-2o+fp-dx-wx" data-ad-client="ca-pub-4605373693034661" data-ad-slot="4561116489"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div><div class="list_con"> <a href="https://www.f2er.com/vue/997423.html" title="element-UI中手动调用table排序"><div class="title">element-UI中手动调用table排序</div> <div class="summary">&amp;lt;el-table :data=&amp;quot;tableData&amp;quot; &amp;quot;width...</div> <time class="summary">作者:前端之家 时间:2021-02-17</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/994895.html" title="Vue双向绑定原理及其实现"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/01-10/13/13055abb3c90b13ed50222b980d4a858.gif" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">Vue双向绑定原理及其实现</div> <div class="summary">在之前面试的时候被面试官问到是否了解Vue双向绑定的原理,其实自己之前看过双向绑定的原理...</div> <time class="summary">作者:前端之家 时间:2021-01-10</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/994894.html" title="Vue事件修饰符详解"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/01-10/13/b4cf1534468c90981806f6f883c8e876.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">Vue事件修饰符详解</div> <div class="summary">整体学习Vue时看到Vue文档中有事件修饰符的描述,但是看了之后并没有理解是什么意思,于是...</div> <time class="summary">作者:前端之家 时间:2021-01-10</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/994741.html" title="Vue-router插件使用"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/01-01/21/bf84b4bbaaac53ea67ceec4898781512.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">Vue-router插件使用</div> <div class="summary">单页面原理 Vue是单页面开发,即页面不刷新。 页面不刷新,而又要根据用户选择完成内容的更...</div> <time class="summary">作者:前端之家 时间:2021-01-01</time> </a> </div> <div class="list_con"> <a href="https://www.f2er.com/vue/994740.html" title="Vue 分支循环"><img class="lazy" src="https://www.f2er.com/images/np.jpg" data-original="https://www.f2er.com/res/2021/01-01/21/ed0d5c51fe9891d0c42f795f23333ec1.png" title="" width="160" height="90" style="float:right;margin-left:30px;display:none;" /><div class="title">Vue 分支循环</div> <div class="summary">v-for 通过v-for进行循环,不光可以拿到元素本身,也可以拿到索引值。 如果数据是对象类型...</div> <time class="summary">作者:前端之家 时间:2021-01-01</time> </a> </div> <div style="border-bottom: 1px solid #f4f4f4;margin-top:20px;"> <ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-fr-2o+fp-dx-wx" data-ad-client="ca-pub-4605373693034661" data-ad-slot="4561116489"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div></div> </div> </div> </div> <!-- left end--> <!-- right --> <div class="col-sm-12 col-md-12 col-lg-3"> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <label class="main-content-label ">编程分类</label> <div class="cate mt-20"><a href="https://www.f2er.com/html/" title="HTML">HTML</a><a href="https://www.f2er.com/html5/" title="HTML5">HTML5</a><a href="https://www.f2er.com/js/" title="JavaScript">JavaScript</a><a href="https://www.f2er.com/css/" title="CSS">CSS</a><a href="https://www.f2er.com/jquery/" title="jQuery">jQuery</a><a href="https://www.f2er.com/bootstrap/" title="Bootstrap">Bootstrap</a><a href="https://www.f2er.com/angularjs/" title="Angularjs">Angularjs</a><a href="https://www.f2er.com/typescript/" title="TypeScript">TypeScript</a><a href="https://www.f2er.com/vue/" title="Vue">Vue</a><a href="https://www.f2er.com/dojo/" title="Dojo">Dojo</a><a href="https://www.f2er.com/json/" title="Json">Json</a><a href="https://www.f2er.com/electron/" title="Electron">Electron</a><a href="https://www.f2er.com/nodejs/" title="Node.js">Node.js</a><a href="https://www.f2er.com/extjs/" title="extjs">extjs</a><a href="https://www.f2er.com/express/" title="Express ">Express </a><a href="https://www.f2er.com/xml/" title="XML">XML</a><a href="https://www.f2er.com/es6/" title="ES6">ES6</a><a href="https://www.f2er.com/ajax/" title="Ajax">Ajax</a><a href="https://www.f2er.com/flash/" title="Flash">Flash</a><a href="https://www.f2er.com/unity/" title="Unity">Unity</a><a href="https://www.f2er.com/react/" title="React">React</a><a href="https://www.f2er.com/flex/" title="Flex">Flex</a><a href="https://www.f2er.com/antdesign/" title="Ant Design">Ant Design</a><a href="https://www.f2er.com/webfrontend/" title="Web前端">Web前端</a><a href="https://www.f2er.com/weapp/" title="微信小程序">微信小程序</a><a href="https://www.f2er.com/wxmp/" title="微信公众号">微信公众号</a><div class="clearfix"></div> </div> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <!-- f2er-rightads --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4605373693034661" data-ad-slot="7756441254" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <label class="main-content-label ">最新文章</label> <ul class="n-list"><li><a href="https://www.f2er.com/vue/997429.html" title="elementui的el-tree第一次加载无法展开和选中的问题" target="_blank">• elementui的el-tree第一次</a></li> <li><a href="https://www.f2er.com/vue/997428.html" title="VSCODE打开一个文件,另一个文件就关闭的问题的解决方法" target="_blank">• VSCODE打开一个文件,另一</a></li> <li><a href="https://www.f2er.com/vue/997427.html" title="一文带你学会国产加密算法SM4的vue实现方案" target="_blank">• 一文带你学会国产加密算法</a></li> <li><a href="https://www.f2er.com/vue/997426.html" title="解决vue报错:Module build failed (from ./node_modules/_eslint-loader@2.2.1@eslint-loader/index.js): TypeError: Cannot read property 'range' of null" target="_blank">• 解决vue报错:Module buil</a></li> <li><a href="https://www.f2er.com/vue/997425.html" title="vue中解决Uncaught ReferenceError: regeneratorRuntime is not defined问题" target="_blank">• vue中解决Uncaught Refere</a></li> <li><a href="https://www.f2er.com/vue/997424.html" title="vue的自定义组件如何使用prop传值?" target="_blank">• vue的自定义组件如何使用p</a></li> <li><a href="https://www.f2er.com/vue/997423.html" title="element-UI中手动调用table排序" target="_blank">• element-UI中手动调用tabl</a></li> <li><a href="https://www.f2er.com/vue/994895.html" title="Vue双向绑定原理及其实现" target="_blank">• Vue双向绑定原理及其实现</a></li> <li><a href="https://www.f2er.com/vue/994894.html" title="Vue事件修饰符详解" target="_blank">• Vue事件修饰符详解</a></li> <li><a href="https://www.f2er.com/vue/994741.html" title="Vue-router插件使用" target="_blank">• Vue-router插件使用</a></li> </ul> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <label class="main-content-label ">热门标签 <span class="pull-right tx-12"> <a href="https://www.f2er.com/all" target="_blank">更多 ►</a></span> </label> <div class="topcard-tags"><a href="https://www.f2er.com/tag/guanbiyangao/" title="关闭广告" target="_blank">关闭广告</a><a href="https://www.f2er.com/tag/danduheaders/" title="单独headers" target="_blank">单独headers</a><a href="https://www.f2er.com/tag/fengzhuangdaima/" title="封装代码" target="_blank">封装代码</a><a href="https://www.f2er.com/tag/tishicuowu/" title="提示错误" target="_blank">提示错误</a><a href="https://www.f2er.com/tag/zhengshuzhengze/" title="整数正则" target="_blank">整数正则</a><a href="https://www.f2er.com/tag/fei0kaitou/" title="非0开头" target="_blank">非0开头</a><a href="https://www.f2er.com/tag/tiaoye/" title="跳页" target="_blank">跳页</a><a href="https://www.f2er.com/tag/chuyema/" title="出页码" target="_blank">出页码</a><a href="https://www.f2er.com/tag/antdtable/" title="antd table" target="_blank">antd table</a><a href="https://www.f2er.com/tag/tishiURLweizhuce/" title="提示URL未注册" target="_blank">提示URL未注册</a><a href="https://www.f2er.com/tag/gongzhonghaozhifu/" title="公众号支付" target="_blank">公众号支付</a><a href="https://www.f2er.com/tag/vuehashmoshi/" title="vue hash模式" target="_blank">vue hash模式</a><a href="https://www.f2er.com/tag/iSlider/" title="iSlider" target="_blank">iSlider</a><a href="https://www.f2er.com/tag/chepaijianpan/" title="车牌键盘" target="_blank">车牌键盘</a><a href="https://www.f2er.com/tag/xunhuantupian/" title="循环图片" target="_blank">循环图片</a><a href="https://www.f2er.com/tag/echartsshuangzhexian/" title="echarts 双折线" target="_blank">echarts 双折</a><a href="https://www.f2er.com/tag/zuoyoubuju/" title="左右布局" target="_blank">左右布局</a><a href="https://www.f2er.com/tag/DllPlugin/" title="DllPlugin" target="_blank">DllPlugin</a><a href="https://www.f2er.com/tag/duixiangchuangjian/" title="对象创建" target="_blank">对象创建</a><a href="https://www.f2er.com/tag/daziyouxi/" title="打字游戏" target="_blank">打字游戏</a><a href="https://www.f2er.com/tag/quanxuan/" title="圈选" target="_blank">圈选</a><a href="https://www.f2er.com/tag/lianglan/" title="两栏" target="_blank">两栏</a><a href="https://www.f2er.com/tag/yunhanshu/" title="云函数" target="_blank">云函数</a><a href="https://www.f2er.com/tag/mengban/" title="蒙版" target="_blank">蒙版</a><a href="https://www.f2er.com/tag/ES2020/" title="ES2020" target="_blank">ES2020</a><a href="https://www.f2er.com/tag/chuchuang/" title="橱窗" target="_blank">橱窗</a><a href="https://www.f2er.com/tag/wufenggundonglunbo/" title="无缝滚动轮播" target="_blank">无缝滚动轮播</a><a href="https://www.f2er.com/tag/sekuaipengzhuang/" title="色块碰撞" target="_blank">色块碰撞</a><a href="https://www.f2er.com/tag/zujianxiaohui/" title="组件销毁" target="_blank">组件销毁</a><a href="https://www.f2er.com/tag/wendangcaozuo/" title="文档操作" target="_blank">文档操作</a></div> </div> </div> </div> <!-- row end --> <!-- row --> <div class="row row-sm"> <div class="col-sm-12 col-md-12 col-lg-12"> <div class="card"> <!-- f2er-rightads --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4605373693034661" data-ad-slot="7756441254" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </div> <!-- row end --> </div> <!-- right end --> </div> </div> <footer id="footer"> <div class="container"> <div class="row hidden-xs"> <dl class="col-sm-6 site-link"> <dt>最近更新</dt><dd><a href="https://www.f2er.com/faq/884225.html" title="jQuery选择伪元素:after" target="_blank">· jQuery选择伪元素:after</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884224.html" title="JavaScript随机颜色生成器" target="_blank">· JavaScript随机颜色生成器</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884223.html" title="JavaScript指数" target="_blank">· JavaScript指数</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884222.html" title="addResourceHandlers无法解析静态资源" target="_blank">· addResourceHandlers无法解析静态资源</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884221.html" title="如何将字节数组转换为MultipartFile" target="_blank">· 如何将字节数组转换为MultipartFile</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884220.html" title="在java中如何创建一个文件并写入内容?" target="_blank">· 在java中如何创建一个文件并写入内容?</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884219.html" title="星号*在Python中是什么意思?" target="_blank">· 星号*在Python中是什么意思?</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884218.html" title="Flask框架:MVC模式" target="_blank">· Flask框架:MVC模式</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884217.html" title="在JavaScript对象数组中按ID查找对象" target="_blank">· 在JavaScript对象数组中按ID查找对象</a><span class="text-muted pull-right">10-20</span></dd> <dd><a href="https://www.f2er.com/faq/884216.html" title="使用Javascript / jQuery下载文件" target="_blank">· 使用Javascript / jQuery下载文件</a><span class="text-muted pull-right">10-20</span></dd> </dl> <dl class="col-sm-4 site-link"> <dt>好站推荐</dt><dd> <a href="https://www.runoob.com" title="菜鸟教程(www.runoob.com)提供了编程的基础技术教程, 介绍了HTML、CSS、Javascript、Python,Java,Ruby,C,PHP , MySQL等各种编程语言的基础知识。 同时本站中也提供了大量的在线实例,通过实例,您可以更好的学习编程。" target="_blank">菜鸟教程</a></dd><dd> <a href="https://www.jb51.cc" title="编程之家(www.jb51.cc)是成立于2017年面向全球中文开发者的技术内容分享平台。提供编程导航、编程问答、编程博文、编程百科、编程教程、编程工具、编程实例等开发者最需要的编程技术内容与开发工具支持,与你一起学习编程,相信编程改变未来!" target="_blank">编程之家</a></dd><dd> <a href="https://www.f2er.com" title="前端之家 f2er.com 前端开发人员所需学习知识手册。" target="_blank">前端之家</a></dd></dl> <dl class="col-sm-2 site-link"> <dt>商务合作</dt> <dd><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=76874919&site=qq&menu=yes">联系我们</a></dd> </dl> </div> <div class="copyright"> Copyright © 2019 前端之家. 当前版本 V7.0.16<br> <span class="ml5">前端之家 版权所有 <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">闽ICP备13020303号-10</a></span> </div> </div> </footer> <script type="text/javascript" src="https://www.f2er.com/js/base.js"></script> </body> </html>