TreeView v1
This commit is contained in:
parent
d1294c2fc4
commit
e9743cd00c
6 changed files with 148 additions and 50 deletions
13
app/javascript/controllers/bs_scrollspy_controller.js
Normal file
13
app/javascript/controllers/bs_scrollspy_controller.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { Controller } from "@hotwired/stimulus"
|
||||
import * as bootstrap from 'bootstrap'
|
||||
|
||||
// Connects to data-controller="bs-scrollspy"
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
// console.log(this.element)
|
||||
const target = this.element.getAttribute("data-bs-scrollspy-target")
|
||||
const scrollSpy = new bootstrap.ScrollSpy(this.element, {
|
||||
target: target
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue