https://www.cnblogs.com/fuckingPangzi/p/10462441.html
小程序的业务域名和服务器域名的区别
服务器域名是 wx.request 请求 去拉取数据的域名。 一般返回为JSON字符串
业务域名是小程序的webview组件要引入的其他H5地址的URL的域名或者网页里面的iframe的域名
如果需要跳过----网络请求域名----的校验,可勾选项目设置里的 “不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书” 选项。
点击工具栏上的预览按钮即可在真机上预览体验。在真机上如需跳过----网络请求域名----的校验,需要点击右上角选项,选择 “打开调试” 即可。
(1)index.html
<head>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
(2)router.js
const routes = [
{
path: '/',
name: 'Index',
component: () => import( /* webpackChunkName: "about" */ '../views/Index.vue'),
meta: {title: '游戏活动'}
}
]
const router = new VueRouter({
routes
})
router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面 title */
if (to.meta.title) {
document.title = to.meta.title //给title赋值
}
next()
})
(3)main.js
Vue.directive('title', {//单个修改标题
update: function (el) {
document.title = el.getAttribute("data-title") //给title赋值
}
})
(4)form.vue
<template>
<div class="page">
<div v-title :data-title="basicData.gameName" ></div>
</div>
</template>