2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-17 19:21:21 +03:00

docs: update for single package

This commit is contained in:
Alexander Shabunevich
2024-06-02 15:43:46 +03:00
parent 9b454e996a
commit 0ef436ca3d
11 changed files with 245 additions and 217 deletions
-36
View File
@@ -1,41 +1,5 @@
# Usage with Alpine.js
## Installation
<!-- tabs:start -->
### **With NPM**
```sh
npm install @maskajs/alpine@3
```
And then register it:
```js
import Alpine from 'alpinejs'
import { xMaska } from '@maskajs/alpine'
Alpine.plugin(xMaska)
...
```
### **From CDN**
You can use Maska directly from CDN using simple script tag with `data-init` attribute, just make sure to include it BEFORE Alpine's core JS file:
```html
<!-- Maska Plugin -->
<script data-init src="https://cdn.jsdelivr.net/npm/@maskajs/alpine@3/dist/maska.umd.js"></script>
<!-- Alpine Core -->
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
```
This will automatically register Maska plugin inside Alpine.
<!-- tabs:end -->
## Directive signature
Maska provides custom Alpine.js directive for use with input:
```html