Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

stimulus target

<div data-controller="search">
  <div data-search-target="results"></div>
</div>
// controllers/search_controller.js
import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static targets = [ "query", "errorMessage", "results" ]
  // …
}
Source by stimulus.hotwired.dev #
 
PREVIOUS NEXT
Tagged: #stimulus #target
ADD COMMENT
Topic
Name
9+6 =