Skip to content

Commit b2c00e6

Browse files
committed
minor #1040 add swup progress bar plugin to docs (Yassine Fikri)
This PR was merged into the 2.x branch. Discussion ---------- add swup progress bar plugin to docs | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Tickets | none | License | MIT updating docs to include swup progress bar plugin as example Commits ------- 0adf067 add swup progress bar example to docs
2 parents 70ef40e + 0adf067 commit b2c00e6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Swup/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)