- Notifications
You must be signed in to change notification settings - Fork0
A swup plugin for integrating Gia frontend components 🏭
License
NotificationsYou must be signed in to change notification settings
swup/gia-plugin
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Aswup plugin for integratingGia frontend components.
Automatically reloads components when required only for the replaced containers.
Install the plugin from npm and import it into your bundle.
npm install @swup/gia-plugin
importSwupGiaPluginfrom'@swup/gia-plugin';
Or include the minified production file from a CDN:
<scriptsrc="https://unpkg.com/@swup/gia-plugin@2"></script>
To run this plugin, include an instance in the swup options.
constswup=newSwup({plugins:[newSwupGiaPlugin()]});
Components to be used for mount/unmount. Defaults to an empty object.
importComponentfrom'gia/Component'classExampleComponentextendsComponent{// ...}constcomponents={ ExampleComponent}constswup=newSwup({plugins:[newSwupGiaPlugin({ components})]})
Whether the components should be loaded on start. Defaults totrue
.
newSwupGiaPlugin({firstLoad:true});
Let Gia report info on mounting/unmounting of components. Corresponds to setting thelog
variableofGia's config). Defaults tofalse
.
newSwupGiaPlugin({log:false});
About
A swup plugin for integrating Gia frontend components 🏭