Skip to content

Commit

Permalink
API:对话框
Browse files Browse the repository at this point in the history
未完成
  • Loading branch information
KingBes committed Dec 18, 2024
1 parent 7eacf20 commit 8a7c758
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/bunny.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions doc/dialog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
对话框

<!-- <button class="bny-btn" hx-on:click="bunny.dialog({'elem':this})">消息</button> -->
<button class="bny-btn" hx-delete="#" hx-confirm="???" bny>消息</button>

<script>
document.body.addEventListener('htmx:confirm', function (evt) {
if (evt.target.matches("[bny]")) {
evt.preventDefault();
console.log(evt.target)
}
});
</script>
2 changes: 1 addition & 1 deletion highlight.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
K("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}
return n.split(/\s+/).find((e=>_(e)||N(e)))})(e);if(_(t))return
;if(O("before:highlightElement",{el:e,language:t
}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e)
}),e.dataset.highlighted)return /* void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e) */
;if(e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),
console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),
console.warn("The element with unescaped HTML:"),
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<div class="bny-tab-item">辅助</div>
<div class="bny-tab-item">公共类</div>
<div class="bny-tab-item">表格</div>
<div class="bny-tab-item">对话框</div>
</div>
<div class="bny-tab-body" hx-trigger="load">
<div class="marked" hx-get="doc/color.md" hx-trigger="load"></div>
Expand All @@ -69,6 +70,7 @@
<div class="marked" hx-get="doc/subsidiary.md" hx-trigger="load"></div>
<div class="marked" hx-get="doc/class.md" hx-trigger="load"></div>
<div class="marked" hx-get="doc/table.md" hx-trigger="load"></div>
<div class="marked" hx-get="doc/dialog.md" hx-trigger="load"></div>
</div>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions src/bunny.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* API组件
*/
let bunny = {
dialog: function (e) {
console.log(typeof e, e)
}
}

export default bunny
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import htmx from "./htmx.js"
import bunny from "./bunny.js"
import "./bny-tab.js"
import "./bny-card.js"
import "./bny-code.js"
import "./bny-marquee.js"
import "./bny-alert.js"
import "./bny-menu.js"

window.htmx = htmx
window.htmx = htmx
window.bunny = bunny

0 comments on commit 8a7c758

Please sign in to comment.