Skip to content

Commit

Permalink
minor #1040 add swup progress bar plugin to docs (Yassine Fikri)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
weaverryan committed Aug 15, 2023
2 parents 70ef40e + 0adf067 commit b2c00e6
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 b2c00e6

Please sign in to comment.