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

导师让做网站网页设计与网站建设报告书

导师让做网站,网页设计与网站建设报告书,优化教程,短视频推广seo隐迅推专业因为我们要根据路由配置对应的图标#xff0c;也要为了后续方便更改。因此我们将所有的图标注册为全局组件。#xff08;使用之前将分页器以及矢量图注册全局组件的自定义插件#xff09;#xff08;所有图标全局注册的方法element-plus文档中已给出#xff09; 全局注册…因为我们要根据路由配置对应的图标也要为了后续方便更改。因此我们将所有的图标注册为全局组件。使用之前将分页器以及矢量图注册全局组件的自定义插件所有图标全局注册的方法element-plus文档中已给出 全局注册elementPlus图标 经过上面的步骤就可以把elementPlus自带的icon图标全局注册了。 路由使用elementPlus图标 给路由元信息添加属性icon 以layout和其子组件为例首先在element-puls找到你要使用的图标的名字。将它添加到路由元信息的icon属性上 {//登录成功以后展示数据的路由path: /,component: () import(/layout/index.vue),name: layout,meta: {title: layout,hidden: false,icon: Avatar,//elementPlus中的图标},children: [{path: /home,component: () import(/views/home/index.vue),meta: {title: 首页,hidden: false,icon: HomeFilled,//elementPlus中的图标},},], },外部引入的svg图标——vite.config.js中批量引入 import { createSvgIconsPlugin } from vite-plugin-svg-icons; export default defineConfig(({command,mode}){const env loadEnv(mode,process.cwd())return {plugins:[vue(),AutoImport({resolvers: [ElementPlusResolver(),IconsResolver({prefix: Icon,}),],}),Components({resolvers: [ElementPlusResolver(),IconsResolver({enabledCollections: [ep],}),],}),Icons({autoInstall: true,}),createSvgIconsPlugin({// Specify the icon folder to be cachediconDirs: [path.resolve(process.cwd(), src/assets/icons)],// Specify symbolId formatsymbolId: icon-[dir]-[name],}),]} })然后svg图标的使用例如全屏图标 el-button iconFullScreen circle clickfullScreen /顺道写下全屏功能的实现 script langts setup import {reactive,ref} from vue; //全屏功能 const fullScreen (){//用来判断是不是全屏返回布尔值const full document.fullscreenElement//有兼容问题if(full){document.exitFullscreen();}else{document.documentElement.requestFullscreen();} } /scriptcomponents中的组件全局批量注册——避免使用时多次引入 步骤一在components文件夹中新建index.ts文件 步骤二在index.ts文件中引入各个组件 import SvgIcon from ./SvgIcon/index.vue import Category from /components/Category/index.vue步骤三使用vue中的App和Component import type { App, Component } from vue const allGlobalComponent: Component { SvgIcon, Category }步骤四使用install方法来处理 export default {install(app: App) {Object.keys(allGlobalComponent).forEach((key: string) {// 注册为全局组件app.component(key, allGlobalComponent[key])})}, }结合文章中第一步的全局引入elementPlus图标也可以放在此文件中 完整代码如下 import SvgIcon from ./SvgIcon/index.vue import Category from /components/Category/index.vue import type { App, Component } from vue import * as ElementPlusIconsVue from element-plus/icons-vue const allGlobalComponent: Component { SvgIcon, Category } export default {install(app: App) {Object.keys(allGlobalComponent).forEach((key: string) {// 注册为全局组件app.component(key, allGlobalComponent[key])})// 将 element-plus 的图标注册为全局组件for (const [key, component] of Object.entries(ElementPlusIconsVue)) {app.component(key, component)}}, }main.ts中引入components import globalComponent from ./components/index const app createApp(App) app.use(globalComponent)
http://www.w-s-a.com/news/194737/

相关文章:

  • 网站开发本地环境企业网站建设排名口碑
  • 做新闻的网站怎样赚钱个人网站课程设计报告
  • 网站设计样例那个网站做图片好看
  • 小型公司网站建设深圳网络营销策划有限公司
  • 国内优秀企业网站做视频网站用什么系统
  • 网站建设入门pdfwordpress网站标题
  • 专业网站的定义网站运营的概念
  • 外贸服装网站建设网页美工设计说明书
  • 郑州专业做网站公百度翻译api wordpress
  • 做网站哪里找大学的一级或二级域名
  • 没有静态ip可以做网站服务器上饶网站制作需要多少钱
  • 网站建设wangzhii做国外网站做什么内容
  • 网站建设 搞笑笑话经典 wordpress主题下载
  • 做网站要懂哪些wordpress 站点网络
  • 郑州外贸网站建设公司排名网站设计做啥好
  • 网站开发合同付款比例wordpress调用指定文章内容
  • 湖北平台网站建设哪里好辽宁建设工程信息网官网平台
  • 公司优化是什么意思?洛阳seo博客
  • 普通建站网站首页制作模板
  • 江苏城乡与住房建设厅网站wordpress 添加导航
  • 免费单页网站在线制作网站制作与网站建设pdf
  • 网站开发使用云数据库技术教程大连模板开发建站
  • 佘山网站建设创造网站需要多少钱
  • 南海佛山网站建设网站维护需要什么技能
  • 阿里云服务器开源做几个网站想找公司做网站
  • 一般做网站是用什么语言开发的域名查询 查询网
  • 地方门户网站源码下载揭阳专业网站建设
  • 网站做优化好还是推广好wordpress百家号模版
  • 淘宝网网站建设的的意见校园微网站建设
  • 小说网站建设之前需求分析免费下载京东购物