获取地址栏上携带的参数信息

/* eslint-disable */
function getUrlKey (name) {
    return decodeURIComponent((new RegExp("[?|&]" + name + "=([^&;]+?)(&|#|;|$)").exec(location.href) || [, ""])[1].replace(/\+/g, "%20")) || null;
}
created() {
  const id = this.getUrlKey('id');
}
posted @ 2024-05-07 16:07  不完美的完美  阅读(7)  评论(0编辑  收藏  举报