Created
November 2, 2021 10:40
-
-
Save shavin-peiries/e1d2ac7a70fb0225c6001ecf3226db29 to your computer and use it in GitHub Desktop.
Stimulus Controller for slim-select.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller } from '@hotwired/stimulus' | |
import SlimSelect from 'slim-select' | |
export default class extends Controller { | |
connect() { | |
this.slimselect = new SlimSelect({ | |
select: this.element, | |
hideSelectedOption: false | |
}) | |
} | |
disconnect() { | |
this.slimselect.destroy() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment