解析url

 if (url && url.length > 0) {
        this.loading = true;
        let param = {
          accept: "text/html, text/plain"
        };
        this.axios.get(url, param)
          .then(response => {
            this.loading = false;
            this.html = response.data;
            let test = this.html.replace(/<.*?>/ig, "")
            this.description = test.substring(0, 36)
          })
          .catch(() => {
            this.loading = false;
            this.html = "加载失败";
          });
      }

发布了20 篇原创文章 · 获赞 6 · 访问量 642

猜你喜欢

转载自blog.csdn.net/LR13567/article/details/105601225