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

保定网站建设方案刷赞网站推广ks

保定网站建设方案,刷赞网站推广ks,软件技术开发合同范本,现在在市场上做网站怎么样在 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://www.dtcms.com/wzjs/101232.html

相关文章:

  • php网站怎么做集群全国疫情最新情况公布
  • 教人做辐射4mod的网站网站优化搜索排名
  • 什么是网站名百度快照seo
  • 雷山网站快速排名浏览器搜索引擎大全
  • 傻瓜式网站建设seo外链优化策略
  • 网站做app如何做线上销售和推广
  • 做网站写的代号好跟不好的区别网页搜索排名提升
  • 手机微网站怎么做南京seo排名优化公司
  • mac做网站设计百度登录个人中心
  • wordpress修改页面title关键词优化方法有什么步骤
  • 做二手房产网站多少钱宁波seo搜索优化费用
  • 深圳招聘网站推荐网络上市场推广
  • 做门窗投标网站百度收录网站入口
  • 有网站代码怎么建设什么是网络推广工作
  • 石大远程网页设计与网站建设答案百度上做推广怎么收费
  • 客服外包项目可以去哪里接seo优化排名服务
  • 自适应网站怎么做企业线上培训平台有哪些
  • 浏阳网站建设hnktwlseo的工作内容
  • 骨科医院网站优化服务商百度一下百度百科
  • 垂直网站 开源码百度一下手机版首页
  • 建设银行安徽分行招聘网站做个电商平台要多少钱
  • 网站建设空间步骤详解免费ip地址代理
  • 合肥 网站建设公司哪家好黄桃图片友情链接
  • 滦平住房和城乡建设厅网站手机如何制作自己的网站
  • 301网站目录足球排行榜前十名
  • 重庆网站建设公司有哪些免费注册网站有哪些
  • 宁波网站设计服务收费价格佛山做优化的网络公司
  • 南平如何做百度的网站小程序开发流程详细
  • 网站建站建设怎么做整合营销传播理论
  • 只做域名跳转和关停网站武汉百度快速排名提升