kopia lustrzana https://github.com/shoelace-style/shoelace
Add button links plugin
rodzic
6a3b2c995d
commit
c77c0716d3
|
@ -0,0 +1,19 @@
|
|||
(() => {
|
||||
if (!window.$docsify) {
|
||||
throw new Error('Docsify must be loaded before installing this plugin.');
|
||||
}
|
||||
|
||||
window.$docsify.plugins.push((hook, vm) => {
|
||||
hook.mounted(function () {
|
||||
|
||||
document.addEventListener('click', event => {
|
||||
const tag = event.target.tagName.toLowerCase();
|
||||
const href = event.target.getAttribute('data-href');
|
||||
|
||||
if (tag === 'sl-button' && href) {
|
||||
window.open(href);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
|
@ -93,5 +93,6 @@
|
|||
<script src="/assets/plugins/code-block/code-block.js"></script>
|
||||
<script src="/assets/plugins/metadata/metadata.js"></script>
|
||||
<script src="/assets/plugins/sidebar/sidebar.js"></script>
|
||||
<script src="/assets/plugins/links/links.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Ładowanie…
Reference in New Issue