mirror of
https://github.com/tenrok/maska.git
synced 2026-06-20 20:00:34 +03:00
chore: alpine new demos
This commit is contained in:
@@ -16,13 +16,31 @@
|
|||||||
x-model="maskedvalue"
|
x-model="maskedvalue"
|
||||||
x-maska:unmaskedvalue.unmasked="options"
|
x-maska:unmaskedvalue.unmasked="options"
|
||||||
x-on:maska="console.log($event.detail)"
|
x-on:maska="console.log($event.detail)"
|
||||||
data-maska="#-#"
|
data-maska="##-##"
|
||||||
>
|
>
|
||||||
<div><label><input type="checkbox" x-model="options.eager"> eager?</label></div>
|
<div><label><input type="checkbox" x-model="options.eager"> eager?</label></div>
|
||||||
<div>masked value: <span x-text="maskedvalue"></span></div>
|
<div>masked value: <span x-text="maskedvalue"></span></div>
|
||||||
<div>unmasked value: <span x-text="unmaskedvalue"></span></div>
|
<div>unmasked value: <span x-text="unmaskedvalue"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div x-data="{
|
||||||
|
maskedvalue: '-1234.90',
|
||||||
|
unmaskedvalue: '',
|
||||||
|
options: { number: { locale: 'ru', fraction: 2 }}
|
||||||
|
}" style="margin-top: 1em">
|
||||||
|
<input
|
||||||
|
x-model="maskedvalue"
|
||||||
|
x-maska:unmaskedvalue.unmasked="options"
|
||||||
|
x-on:maska="console.log($event.detail)"
|
||||||
|
>
|
||||||
|
<div>masked value: <span x-text="maskedvalue"></span></div>
|
||||||
|
<div>unmasked value: <span x-text="unmaskedvalue"></span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div x-data style="margin-top: 1em">
|
||||||
|
<input x-maska data-maska="+1 (###) ###-####" data-maska-eager value="1234567">
|
||||||
|
</div>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import Alpine from 'alpinejs'
|
import Alpine from 'alpinejs'
|
||||||
import { xMaska } from './src'
|
import { xMaska } from './src'
|
||||||
|
|||||||
Reference in New Issue
Block a user