1、ant-design-vue 组件a-popover
问题: 鼠标第一次悬浮定位不准确,再次悬浮定位就准确了。
解决:卡片样式overlayStyle:加宽高
<a-popover :placement="placement"
:overlayStyle="{width: '205px',height: 'auto'}"
:arrow-point-at-center="true">
<slot slot="content"
name="content">
<p>{{content}}</p>
</slot>
<a-icon class="ml-5"
:style='style'
:type="icon" />
</a-popover>
2、 vue路由地址新开页面
protected handleFnName(data: type): void {
let routeUrl = this.$router.resolve({
name: 'EditOrder',
query: {
code: data.code,
},
});
window.open(routeUrl.href, '_blank');
}
3、解决跨域
(1)绕过浏览器同源策略 关闭Chrome 浏览器,右键点击 桌面Chrome 浏览器 -> 属性 -> 目标 -> 在 chrome.exe 路径后面添加代码 --disable-web-security --user-data-dir="<自定义目录>"。(<自定义目录> 例如:D:\MyChromeData) 设置成功打开浏览器会提示: 您使用的是不受支持的命令行标记:--disable-web-security。稳定性称和安全性会有所下降。
(2)post请求入参添加配置 devDebug: 'jing',
在axios发起请求前判断:
if (conf.devDebug === 'jing') {
conf.baseURL = '协议://环境域名(或者ip:端口号)/接口前缀';
conf.headers.Authorization = 'Bearer <KEY>';
}
其中KEY: 环境header头的token