1.8.x Tính Năng: Alpine.js

Preview

Tác giả: tedem

Phiên bản: 2.0.2

Gửi lúc: 04/12/2022

Cập nhật lúc: 20/02/2023

Third Party Integration Admin Control Panel
Mô tả
It adds the required scripts for the Alpine.js library to your MyBB theme and enables you to use the Alpine.js magics ($el, $refs, $store, ...) that are not allowed by the MyBB 1.8 theme engine.

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 (scp command.) or FTP (FileZilla, CuteFTP, etc.).
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:

$el{$alpinejs['el']}
$refs{$alpinejs['refs']}
$store{$alpinejs['store']}
$watch{$alpinejs['watch']}
$dispatch{$alpinejs['dispatch']}
$nextTick{$alpinejs['nextTick']}
$root{$alpinejs['root']}
$data{$alpinejs['data']}
$id{$alpinejs['id']}

Example:

$el.innerHTML = <button @click="{$alpinejs['el']}.innerHTML = 'Hello World!'">Replace me with "Hello World!"</button>

Happy Coding!
Nó thêm các tập lệnh cần thiết cho Alpine.js vào chủ đề MyBB của bạn và cho phép bạn sử dụng Alpine.js Phép thuật ($el, $refs, $store, ...) không được công cụ chủ đề MyBB 1.8 cho phép.

Chi tiết

Phiên bản: 2.0.0
Phiên bản MyBB: 1.8.x

Cài đặt

1. Tải xuống plugin.
2. Tải các tệp trong thư mục "Tải lên" lên thư mục gốc của diễn đàn của bạn với SCP (Scp lệnh.) hoặc FTP (FileZilla, CuteFTP, v.v.).
3. Cài đặt và kích hoạt plugin có tên Alpine.js từ Admin CP → Configuration → (Từ bên trái.) Trang Plugins.

Gỡ cài đặt

1. Gỡ cài đặt plugin có tên Alpine.js khỏi → cấu hình → CP quản trị (Từ bên trái.) Trang Plugins.

Cập nhật

1. Đầu tiên, thực hiện phần "Gỡ cài đặt", sau đó thực hiện phần "Cài đặt" (với tệp mới).

Sử dụng

Bạn có thể xem lại Alpine.js trang tài liệu để sử dụng.

Các biến bạn sẽ sử dụng trong các mẫu cho phép thuật Alpine.js như sau:

$el{$alpinejs['the']}
$refs{$alpinejs['tham khảo']}
$store{$alpinejs['cửa hàng']}
$watch{$alpinejs['đồng hồ']}
$dispatch{$alpinejs['công văn']}
$nextTick{$alpinejs['tick tiếp theo']}
$root{$alpinejs['gốc']}
$data{$alpinejs['dữ liệu']}
$id{$alpinejs['id']}

Ví dụ:

$el.bên trongHTML = <button @click="{$alpinejs['el']}.innerHTML = 'Hello World!'">Thay thế tôi bằng "Hello World!"</button>

Chúc bạn viết mã vui vẻ!