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

学做美食的网站视频佛山建网站永网

学做美食的网站视频,佛山建网站永网,西安网站建设云阔,个人网站 空间在 main.js 中动态设置标题 需求:不同的网址浏览器页签名称要不同 实现方法:在 main.js 中动态设置标题 // 动态设置页面标题 document.addEventListener(DOMContentLoaded, () > {const title window.location.pathname.includes("/en/&q…

在 main.js 中动态设置标题

  1. 需求:不同的网址浏览器页签名称要不同
    在这里插入图片描述
    在这里插入图片描述

  2. 实现方法:在 main.js 中动态设置标题

// 动态设置页面标题
document.addEventListener('DOMContentLoaded', () => {const title = window.location.pathname.includes("/en/") ? 'Support System' : '支持系统';document.title = title;
});

使用 document.addEventListener('DOMContentLoaded', ...) 确保 DOM 完全加载后再设置标题。
根据 window.location.pathname 判断当前语言,并设置相应的标题。

main.js完整代码如下:

import Vue from "vue";import App from "./App.vue";
import store from "./store";
import router from "./router";
import "virtual:svg-icons-register";import directive from "./directive"; //directive
Vue.use(directive);//VueMeta
import VueMeta from "vue-meta";
Vue.use(VueMeta);//Cookie
import Cookies from "js-cookie";import "@/style.css";
import "animate.css";import "@support/assets/styles/index.scss"; // global css
import "@support/assets/styles/ruoyi.scss"; // ruoyi cssimport "./permission";
import "@/echarts";// VXETable
import VXETable from "vxe-table";
Vue.use(VXETable);
import VXETablePluginExportXLSX from "vxe-table-plugin-export-xlsx";
VXETable.use(VXETablePluginExportXLSX);
import "vxe-table/lib/style.css";
import "xe-utils";import Draggable from "vuedraggable";
Vue.component("Draggable", Draggable);import VueContextMenu from "vue-contextmenu";
Vue.use(VueContextMenu);import Element from "element-ui";
import VueI18n from "vue-i18n";
import en from "element-ui/lib/locale/lang/en";
import zhCN from "element-ui/lib/locale/lang/zh-CN";
import "@support/assets/styles/element-variables.scss";
Element.Dialog.props.closeOnClickModal.default = false;
Element.Dialog.props.appendToBody.default = true;
Element.TableColumn.props.showOverflowTooltip = {type: Boolean,default: true
};
Vue.use(VueI18n)
const i18n = new VueI18n({locale: window.location.pathname.includes("/en/") ? en : zhCN,// locale: en,messages: {en: { ...en },zhCN: { ...zhCN }}
});Element.locale(i18n.locale)Vue.use(Element, {size: Cookies.get("size") || "medium" ,// set element-ui default size// i18n: (key, value) => i18n.t(key, value)
});import { NofeelUI } from "nofeel-ui";
Vue.use(NofeelUI);Vue.config.productionTip = false;import "./prototype.js";import "@support/utils/observe";// 动态设置页面标题
document.addEventListener("DOMContentLoaded", () => {const title = window.location.pathname.includes("/en/") ? "Support System" : "支持系统";document.title = title;
})export default new Vue({el: "#app",router,store,// i18n,render: (h) => h(App)
});

文章转载自:

http://jCs5SdA6.tjsxx.cn
http://M9NKaZ8s.tjsxx.cn
http://FGEGSkHY.tjsxx.cn
http://7BwZFZZJ.tjsxx.cn
http://9lyDVSqm.tjsxx.cn
http://F0qCHTEq.tjsxx.cn
http://CcsvfaLp.tjsxx.cn
http://nFnPpz4p.tjsxx.cn
http://ftechlvp.tjsxx.cn
http://qPoJuD2M.tjsxx.cn
http://xCuYYvPC.tjsxx.cn
http://jhtAtOuc.tjsxx.cn
http://mtJuCKZ5.tjsxx.cn
http://KexgBYOi.tjsxx.cn
http://WoAYyIqY.tjsxx.cn
http://MST2lF3O.tjsxx.cn
http://73ZzNqwB.tjsxx.cn
http://T54ibwUR.tjsxx.cn
http://uvJfjJYg.tjsxx.cn
http://bIbrYewL.tjsxx.cn
http://mjcm7ouJ.tjsxx.cn
http://7ewhfEbP.tjsxx.cn
http://7OkHNNaw.tjsxx.cn
http://g9dSxxVi.tjsxx.cn
http://pGMbgd1u.tjsxx.cn
http://ec5FdZIJ.tjsxx.cn
http://NjTVaC5C.tjsxx.cn
http://ZRfPX8GQ.tjsxx.cn
http://5D9UIb5b.tjsxx.cn
http://YTkR5ysP.tjsxx.cn
http://www.dtcms.com/wzjs/630838.html

相关文章:

  • 给个网站好人有好报2020免费网页设计网站图片
  • 海北wap网站建设公司网页界面设计主要内容有哪些
  • 提示该域名为lp网站企业平台是什么意思
  • 一级a做爰片了网站赣州章贡区人口
  • 网站的信息架构自己做的创意的网站
  • soho建网站大连网站推广
  • 资源下载类网站源码建筑工地平台
  • 网站如何开通微信支付接口入户广州网站
  • 网站标题如何写wordpress可以自己写代码吗
  • 做网站 广州推荐电商网站建设
  • 京东优惠券网站怎么做电商网站架构
  • php做听歌网站品牌策划师
  • 免费制作的网站关于门户网站建设的整改报告
  • 济宁嘉祥网站建设户型设计软件免费
  • 网站建设模块有哪些wordpress搭建知识库
  • 优秀企业网站建设公司杭州营销型网站建设
  • 商城网站开发视频建设网站前景怎么样
  • 广州企业模板建站wordpress多媒体权限
  • dede 汽车网站系统开发必须遵守的原则有哪些
  • 网站上做网上支付功能响应式设计的网站
  • 内乡微网站开发那些网站可以够买域名
  • 泉州企业网站制作毕业设计网站开发的目的和意义
  • 青岛即墨网站建设设计产品展示网站方案
  • 上海网站建设设计制作无锡建设招标网站
  • 织梦搭建商城网站专业电容层析成像代做网站
  • 海外仓网站建设seo对网店推广的作用
  • 毕设 网站开发的必要性佛山市网站建站网站
  • 创建一个网站的英文港口备案怎么在网站做
  • 手机网站安全证书过期怎么处理线上推广软件
  • 东莞怎么制作网站口碑营销的重要性