friends-of-hyva/magento2-alpinejs-persist
Composer 安装命令:
composer require friends-of-hyva/magento2-alpinejs-persist
包简介
Integrate the AlpineJS persist plugin into Hyvä
README 文档
README
This is a Magento module specifically for Hyvä, which adds the AlpineJS persist plugin to Hyvä. This plugin allows you to persist Alpine.js component data between page reloads.
Alpine.js Persist Plugin
The Alpine.js persist plugin is a plugin that allows you to persist Alpine.js component data between page reloads. This plugin can be used to store data associated with Alpine.js components in the browser's local storage or session storage, allowing it to be retrieved and restored when the user returns to the page.
For more information on how to use the AlpineJS persist plugin, please refer to the official Alpine.js documentation.
Example
To use the persist plugin in your Hyvä theme, you can add the $persist property to your Alpine.js component and specify which data properties should be persisted.
<div x-data="{ count: $persist(0) }"> <button x-on:click="count++">Increment</button> <span x-text="count"></span> </div>
In this Alpine.js example, the count property is initialized with a default value of 0 using the $persist function, which enables the property to persist its value between page reloads using local storage.
Installation
To install the FriendsOfHyva_AlpineJsPersist module via composer, run the following command:
composer require friends-of-hyva/magento2-alpinejs-persist
This module requires Hyvä theme 1.2.0 or higher and AlpineJS v3.
Using AlpineJS persist to save Magewire component data
Note
This module is made specifically for Hyvä and doesn't work with native Magento.
For more information on Hyvä, please visit the official Hyvä website.
Copyright & License
Copyright (c) 2023 Friends of Hyvä
The module is released under the MIT.
friends-of-hyva/magento2-alpinejs-persist 适用场景与选型建议
friends-of-hyva/magento2-alpinejs-persist 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 2.89k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2023 年 11 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 friends-of-hyva/magento2-alpinejs-persist 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 friends-of-hyva/magento2-alpinejs-persist 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-16