04.12.2022, 23:25
(Dieser Beitrag wurde zuletzt bearbeitet: 14.11.2024, 10:45 von MyBB.de Bot.)
Eine neue Erweiterung wurde veröffentlicht: Alpine.js
Zitat:It adds the required scripts for the Alpine.js library to your MyBB theme and enables you to use the Alpine.js magics () that are not allowed by the MyBB 1.8 theme engine.Code:$el, $refs, $store, ...
Details
Version: 2.0.0
MyBB Versions: 1.8.x
Install
1. Download the plugin.
2. Upload the files in the "Upload" folder to the root directory of your forum with SCP (command.) or FTP (FileZilla, CuteFTP, etc.).Code:scp
3. Install and activate the plugin named Alpine.js from the Admin CP → Configuration → (From left.) Plugins page.
Uninstall
1. Uninstall the plugin named Alpine.js from the Admin CP → Configuration → (From left.) Plugins page.
Update
1. First, perform the "Uninstall" section, then perform the "Install" (with new files) section.
Usage
You can review the Alpine.js documentation page for usage.
The variables you will use in templates for Alpine.js magics are as follows:
→Code:$el
Code:{$alpinejs['el']}
→Code:$refs
Code:{$alpinejs['refs']}
→Code:$store
Code:{$alpinejs['store']}
→Code:$watch
Code:{$alpinejs['watch']}
→Code:$dispatch
Code:{$alpinejs['dispatch']}
→Code:$nextTick
Code:{$alpinejs['nextTick']}
→Code:$root
Code:{$alpinejs['root']}
→Code:$data
Code:{$alpinejs['data']}
→Code:$id
Code:{$alpinejs['id']}
Example:
=Code:$el.innerHTML
Code:<button @click="{$alpinejs['el']}.innerHTML = 'Hello World!'">Replace me with "Hello World!"</button>
Happy Coding!