Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage in Vue 3 without this package #26

Open
Healyhatman opened this issue Nov 29, 2023 · 0 comments
Open

Usage in Vue 3 without this package #26

Healyhatman opened this issue Nov 29, 2023 · 0 comments

Comments

@Healyhatman
Copy link

I was unable to make this work in typescript it just kept whingeing at me and refused to build.

Just in case someone else tries to google how to make this work in Vue 3 with typescript, do the following.

Step 1: Install inputmask
npm i inputmask

Step 2: Set up your app.ts

import Inputmask from "inputmask";
import createApp from "vue";

const app = createApp({});

app.directive("mask", (el, binding) => Inputmask(binding.value).mask(el));

Step 3: That's it.
Use it with <input v-mask="{put all your normal RobinHerbots options here}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant