From 154d92c5def0e230100c7466210a4b373f042e54 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Sun, 3 Sep 2023 18:59:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/js/custom.js | 151 +++++++++----------------- templates/modules/layouts/layout.html | 1 - 2 files changed, 54 insertions(+), 98 deletions(-) diff --git a/templates/assets/js/custom.js b/templates/assets/js/custom.js index cf7a046a..b25d40bb 100644 --- a/templates/assets/js/custom.js +++ b/templates/assets/js/custom.js @@ -300,60 +300,60 @@ document.addEventListener("DOMContentLoaded", () => { // 分栏 tab - customElements.define( - "hao-tabs", - class HaoTabs extends HTMLElement { - constructor() { - super(); - this.options = { - id: this.getAttribute("id") || '', - index: this.getAttribute("index") || '' - }; - const id = this.options.id - const index = this.options.index - const _temp = getChildren(this, "_tpl"); - - let _innerHTML = _temp.innerHTML.trim().replace(/^(
)|(
)$/g, ""); - let navs = ""; - let contents = ""; - let newIndex = 0; - - _innerHTML.replace( - /{tabs-item([^}]*)}([\s\S]*?){\/tabs-item}/g, - function ($0, $1, $2) { - newIndex +=1; - let active ='' - if(index!='' && index!=null){ - if(newIndex == index){ - active = 'active'; - } - }else{ - if(newIndex==1){ - active = 'active' - } - } - navs += ` -
  • - `; - contents += ` -
    - ${$2.trim().replace(/^(
    )|(
    )$/g, "")} - -
    - `; - } - ); - let htmlStr = ` -
    - -
    ${contents}
    -
    - - `; - this.innerHTML = htmlStr; - } - } - ); + // customElements.define( + // "hao-tabs", + // class HaoTabs extends HTMLElement { + // constructor() { + // super(); + // this.options = { + // id: this.getAttribute("id") || '', + // index: this.getAttribute("index") || '' + // }; + // const id = this.options.id + // const index = this.options.index + // const _temp = getChildren(this, "_tpl"); + // + // let _innerHTML = _temp.innerHTML.trim().replace(/^(
    )|(
    )$/g, ""); + // let navs = ""; + // let contents = ""; + // let newIndex = 0; + // + // _innerHTML.replace( + // /{tabs-item([^}]*)}([\s\S]*?){\/tabs-item}/g, + // function ($0, $1, $2) { + // newIndex +=1; + // let active ='' + // if(index!='' && index!=null){ + // if(newIndex == index){ + // active = 'active'; + // } + // }else{ + // if(newIndex==1){ + // active = 'active' + // } + // } + // navs += ` + //
  • + // `; + // contents += ` + //
    + // ${$2.trim().replace(/^(
    )|(
    )$/g, "")} + // + //
    + // `; + // } + // ); + // let htmlStr = ` + //
    + // + //
    ${contents}
    + //
    + // + // `; + // this.innerHTML = htmlStr; + // } + // } + // ); // gallerygroup 相册图库 customElements.define( @@ -591,47 +591,4 @@ document.addEventListener("DOMContentLoaded", () => { } ); - customElements.define( - "hao-bilibili", - class HaoBilibili extends HTMLElement { - constructor() { - super(); - this.options = { - bvid: this.getAttribute("bvid"), - page: +(this.getAttribute("page") || "1"), - width: this.getAttribute("width") || "100%", - height: this.getAttribute("height") || "500px", - }; - this.render(); - } - render() { - if (this.options.bvid) - this.innerHTML = ``; - else this.innerHTML = "bvid未填写!"; - } - } - ); - - // customElements.define( - // "hao-pdf", - // class HaoPdf extends HTMLElement { - // constructor() { - // super(); - // this.options = { - // src: this.getAttribute("src") || "", - // width: this.getAttribute("width") || "100%", - // height: this.getAttribute("height") || "500px", - // }; - // this.render(); - // } - // render() { - // if (!this.options.src) return (this.innerHTML = "pdf地址未填写!"); - // this.innerHTML = ` - //
    - // - //
    `; - // } - // } - // ); - }); diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 49069ef6..d9a31e12 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -12,7 +12,6 @@ -