使用默认bootstrap.js
(来自symfony/webpack-encore-bundle)...
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,
/\.[jt]sx?$/,
));
...刺激控制器从assets/controllers/
加载。
有没有办法也从另一个目录加载控制器?
1条答案
按热度按时间fcg9iug31#
将此
import
添加到controllers.js
:在底部:
来源: