Skip to content

Commit

Permalink
add swup progress bar example to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinefikri committed Aug 8, 2023
1 parent 02ae73b commit 0adf067
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Swup/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Stimulus controller:
// assets/controllers/myswup_controller.js
import { Controller } from '@hotwired/stimulus';
import SwupProgressPlugin from '@swup/progress-plugin';
export default class extends Controller {
connect() {
Expand All @@ -160,6 +161,7 @@ Stimulus controller:
_onPreConnect(event) {
// Swup has not been initialized - options can be changed
console.log(event.detail.options); // Options that will be used to initialize Swup
event.detail.options.plugins.push(new SwupProgressPlugin()); // Adding the progress bar plugin
}
_onConnect(event) {
Expand Down

0 comments on commit 0adf067

Please sign in to comment.