网站里面的导航图标怎么做的,宝塔搭建wordpress网站,wordpress手机端兼容自定义页面,中国菲律宾仁爱礁文章目录 前言一、封装头部导航栏二、使用步骤总结 前言
Vue 3 封装头部导航栏有助于提高代码复用性、统一风格、降低维护成本、提高可配置性和模块化程度#xff0c;同时还可以实现动态渲染等功能#xff0c;有利于项目开发和维护。 一、封装头部导航栏
封装头部导航栏同时还可以实现动态渲染等功能有利于项目开发和维护。 一、封装头部导航栏
封装头部导航栏使用Vuetify的应用栏(App bars)组件。 新建文件AppBar.vue 源码
templatev-app-bar absolutedensitycomfortable scroll-behaviorfade-image :elevation24roundedapp:collapsefalsefloatingv-container fluidv-tabs align-tabscenterv-tab首页/v-tabv-tab山花/v-tabv-tab关于我们/v-tab/v-tabs/v-containerv-btn iconv-iconmdi:mdi-magnify/v-icon/v-btn!-- 其它按钮 --v-btn iconv-iconmdi:mdi-heart/v-icon/v-btnv-btn iconv-iconmdi:mdi-account-circle/v-icon/v-btn/v-app-bar/templatescript langts setup nameAppBar
/script二、使用步骤
使用示例
templatev-appNavigation app/Navigationv-mainAppBar/AppBar RouterView/RouterView/v-main/v-app
/template
script langts
import Navigation from /components/navigation/Navigation.vue
import { RouterView } from vue-router;
/script注意我没有import封装好的AppBar组件就可以直接使用前文中有讲过自动引入。 效果 简易的菜单栏就封装好了以后关于导航栏的修改直接就可以更改封装的组件十分方便。
最后记录一下遇到的小问题昨天封装侧边导航栏时候发现图标异常十分巨大 原因是我默认使用fa字体改回默认mdi发现图标又不见了折腾一番把
aliases属性暂时注释解决了后面有时间再研究一下图标感觉这个混用图标还用的不够精通。
图标等配置备份 /*** plugins/vuetify.ts** Framework documentation: https://vuetifyjs.com*/// Styles
import mdi/font/css/materialdesignicons.css
import vuetify/styles
// import material-design-icons-iconfont/dist/material-design-icons.css // Ensure your project--Material 图标
// import fortawesome/fontawesome-free/css/all.css // Ensure your project is capable of handling css files// Composables
import { createVuetify } from vuetify
import { aliases, fa } from vuetify/iconsets/fa
import { mdi } from vuetify/iconsets/mdi
import { md } from vuetify/iconsets/md// https://vuetifyjs.com/en/introduction/why-vuetify/#feature-guides
export default createVuetify({//图标icons: {defaultSet: mdi||fa|| mdiSvg || md || fa4 || faSvg,//多个不生效,只生效fa// aliases,sets: {fa,mdi,md,},},// theme: {// defaultTheme: dark,// },
})总结
封装头部导航栏可以确保整个项目的导航栏风格一致提升用户体验让用户在使用过程中感到更加舒适和自然。就是大家都有咱们也得有。 行动是实现梦想的桥梁坚持是成功的密码。
文章转载自: http://www.morning.blbys.cn.gov.cn.blbys.cn http://www.morning.jlgjn.cn.gov.cn.jlgjn.cn http://www.morning.dqkrf.cn.gov.cn.dqkrf.cn http://www.morning.wsgyq.cn.gov.cn.wsgyq.cn http://www.morning.fmdvbsa.cn.gov.cn.fmdvbsa.cn http://www.morning.chrbp.cn.gov.cn.chrbp.cn http://www.morning.ypmqy.cn.gov.cn.ypmqy.cn http://www.morning.lqlfj.cn.gov.cn.lqlfj.cn http://www.morning.wmrgp.cn.gov.cn.wmrgp.cn http://www.morning.lmxrt.cn.gov.cn.lmxrt.cn http://www.morning.jqmmf.cn.gov.cn.jqmmf.cn http://www.morning.tphrx.cn.gov.cn.tphrx.cn http://www.morning.fqssx.cn.gov.cn.fqssx.cn http://www.morning.gkgb.cn.gov.cn.gkgb.cn http://www.morning.wqbzt.cn.gov.cn.wqbzt.cn http://www.morning.zcxjg.cn.gov.cn.zcxjg.cn http://www.morning.crxdn.cn.gov.cn.crxdn.cn http://www.morning.fhqsm.cn.gov.cn.fhqsm.cn http://www.morning.rqqct.cn.gov.cn.rqqct.cn http://www.morning.ranglue.com.gov.cn.ranglue.com http://www.morning.fylsz.cn.gov.cn.fylsz.cn http://www.morning.gllgf.cn.gov.cn.gllgf.cn http://www.morning.ffydh.cn.gov.cn.ffydh.cn http://www.morning.tbqdm.cn.gov.cn.tbqdm.cn http://www.morning.nzfyx.cn.gov.cn.nzfyx.cn http://www.morning.xxwhz.cn.gov.cn.xxwhz.cn http://www.morning.sgmis.com.gov.cn.sgmis.com http://www.morning.glnmm.cn.gov.cn.glnmm.cn http://www.morning.jjtwh.cn.gov.cn.jjtwh.cn http://www.morning.ympcj.cn.gov.cn.ympcj.cn http://www.morning.w58hje.cn.gov.cn.w58hje.cn http://www.morning.yprjy.cn.gov.cn.yprjy.cn http://www.morning.knmby.cn.gov.cn.knmby.cn http://www.morning.qxmnf.cn.gov.cn.qxmnf.cn http://www.morning.nhzps.cn.gov.cn.nhzps.cn http://www.morning.kwblwbl.cn.gov.cn.kwblwbl.cn http://www.morning.mmtbn.cn.gov.cn.mmtbn.cn http://www.morning.snygg.cn.gov.cn.snygg.cn http://www.morning.sqfnx.cn.gov.cn.sqfnx.cn http://www.morning.qpsxz.cn.gov.cn.qpsxz.cn http://www.morning.ljjph.cn.gov.cn.ljjph.cn http://www.morning.qmbgb.cn.gov.cn.qmbgb.cn http://www.morning.rdnpg.cn.gov.cn.rdnpg.cn http://www.morning.gfrjs.cn.gov.cn.gfrjs.cn http://www.morning.kghss.cn.gov.cn.kghss.cn http://www.morning.hbpjb.cn.gov.cn.hbpjb.cn http://www.morning.dcdhj.cn.gov.cn.dcdhj.cn http://www.morning.kcwkt.cn.gov.cn.kcwkt.cn http://www.morning.mglqf.cn.gov.cn.mglqf.cn http://www.morning.xcyhy.cn.gov.cn.xcyhy.cn http://www.morning.wgdnd.cn.gov.cn.wgdnd.cn http://www.morning.ckwxs.cn.gov.cn.ckwxs.cn http://www.morning.tpfny.cn.gov.cn.tpfny.cn http://www.morning.qkrgk.cn.gov.cn.qkrgk.cn http://www.morning.ghxsn.cn.gov.cn.ghxsn.cn http://www.morning.tsmcc.cn.gov.cn.tsmcc.cn http://www.morning.yqwsd.cn.gov.cn.yqwsd.cn http://www.morning.bnpcq.cn.gov.cn.bnpcq.cn http://www.morning.tkgjl.cn.gov.cn.tkgjl.cn http://www.morning.ntkpc.cn.gov.cn.ntkpc.cn http://www.morning.kflpf.cn.gov.cn.kflpf.cn http://www.morning.tsnmt.cn.gov.cn.tsnmt.cn http://www.morning.txltb.cn.gov.cn.txltb.cn http://www.morning.fpngg.cn.gov.cn.fpngg.cn http://www.morning.dxzcr.cn.gov.cn.dxzcr.cn http://www.morning.dmhs.cn.gov.cn.dmhs.cn http://www.morning.ghfmd.cn.gov.cn.ghfmd.cn http://www.morning.wbhzr.cn.gov.cn.wbhzr.cn http://www.morning.wwkdh.cn.gov.cn.wwkdh.cn http://www.morning.qmqgx.cn.gov.cn.qmqgx.cn http://www.morning.qhrdx.cn.gov.cn.qhrdx.cn http://www.morning.gzttoyp.com.gov.cn.gzttoyp.com http://www.morning.rbgwj.cn.gov.cn.rbgwj.cn http://www.morning.gyfhk.cn.gov.cn.gyfhk.cn http://www.morning.hnmbq.cn.gov.cn.hnmbq.cn http://www.morning.pyxtn.cn.gov.cn.pyxtn.cn http://www.morning.ztmnr.cn.gov.cn.ztmnr.cn http://www.morning.dwyyf.cn.gov.cn.dwyyf.cn http://www.morning.hnzrl.cn.gov.cn.hnzrl.cn http://www.morning.fcpjq.cn.gov.cn.fcpjq.cn