Skip to content

Commit 2f69f17

Browse files
committed
add swup progress bar example to docs
1 parent 28eed50 commit 2f69f17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Stimulus controller:
144144
// assets/controllers/myswup_controller.js
145145
146146
import { Controller } from '@hotwired/stimulus';
147+
import SwupProgressPlugin from '@swup/progress-plugin';
147148
148149
export default class extends Controller {
149150
connect() {
@@ -160,6 +161,7 @@ Stimulus controller:
160161
_onPreConnect(event) {
161162
// Swup has not been initialized - options can be changed
162163
console.log(event.detail.options); // Options that will be used to initialize Swup
164+
event.detail.options.plugins.push(new SwupProgressPlugin()); // Adding the progress bar plugin
163165
}
164166
165167
_onConnect(event) {

0 commit comments

Comments
 (0)