Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'alpinejs/packages/alpinejs/src/directives/x-id.js')
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-id.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/alpinejs/packages/alpinejs/src/directives/x-id.js b/alpinejs/packages/alpinejs/src/directives/x-id.js
new file mode 100644
index 0000000..897f279
--- /dev/null
+++ b/alpinejs/packages/alpinejs/src/directives/x-id.js
@@ -0,0 +1,8 @@
+import { directive } from "../directives"
+import { setIdRoot } from '../ids'
+
+directive('id', (el, { expression }, { evaluate }) => {
+ let names = evaluate(expression)
+
+ names.forEach(name => setIdRoot(el, name))
+})