- 动态创建a标签 http跳转https
- methods: {
- open(url, rel, target) {
- var a = document.createElement("a");
- a.href = url;
- a.target = target;
- a.rel = rel;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a)
- }
- },
- mounted() {
- getHikvisionUrl().then(res => {
- let url = res.data + '';
- this.open(url,'noreferrer','_blank')
- });
- }