parent
0f8a358be9
commit
53e54667dd
10 changed files with 78 additions and 20 deletions
@ -0,0 +1,12 @@ |
||||
/* |
||||
* Welcome to your app's main JavaScript file! |
||||
* |
||||
* We recommend including the built version of this JavaScript file |
||||
* (and its CSS file) in your base layout (base.html.twig). |
||||
*/ |
||||
|
||||
// any CSS you import will output into a single css file (app.css in this case)
|
||||
import './styles/app.css'; |
||||
|
||||
// start the Stimulus application
|
||||
import './bootstrap'; |
@ -0,0 +1,11 @@ |
||||
import { startStimulusApp } from '@symfony/stimulus-bridge'; |
||||
|
||||
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
|
||||
export const app = startStimulusApp(require.context( |
||||
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers', |
||||
true, |
||||
/\.(j|t)sx?$/ |
||||
)); |
||||
|
||||
// register any custom, 3rd party controllers here
|
||||
// app.register('some_controller_name', SomeImportedController);
|
@ -0,0 +1,4 @@ |
||||
{ |
||||
"controllers": [], |
||||
"entrypoints": [] |
||||
} |
@ -0,0 +1,16 @@ |
||||
import { Controller } from 'stimulus'; |
||||
|
||||
/* |
||||
* This is an example Stimulus controller! |
||||
* |
||||
* Any element with a data-controller="hello" attribute will cause |
||||
* this controller to be executed. The name "hello" comes from the filename: |
||||
* hello_controller.js -> "hello" |
||||
* |
||||
* Delete this file or adapt it for your use! |
||||
*/ |
||||
export default class extends Controller { |
||||
connect() { |
||||
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js'; |
||||
} |
||||
} |
@ -0,0 +1,3 @@ |
||||
body { |
||||
background-color: lightgray; |
||||
} |
Loading…
Reference in new issue