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 += `
-