a11yist/app/javascript/controllers/bs_scrollspy_controller.js
david e569bcb246
Some checks failed
/ Run tests (push) Successful in 1m52s
/ Run system tests (push) Failing after 2m3s
/ Build, push and deploy image (push) Successful in 1m45s
Cosmetics
2024-11-11 05:00:51 +01:00

12 lines
359 B
JavaScript

import { Controller } from "@hotwired/stimulus"
import * as bootstrap from 'bootstrap'
// Connects to data-controller="bs-scrollspy"
export default class extends Controller {
connect() {
const target = this.element.getAttribute("data-bs-scrollspy-target")
const scrollSpy = new bootstrap.ScrollSpy(this.element, {
target: target
})
}
}