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

Does not works in VUE 3 + Server Sider Rendering #184

Open
murilolivorato opened this issue Dec 12, 2021 · 5 comments
Open

Does not works in VUE 3 + Server Sider Rendering #184

murilolivorato opened this issue Dec 12, 2021 · 5 comments

Comments

@murilolivorato
Copy link

Hello , in VUE 3 , use components like this, will not work -
<the-mask :mask="['###.###.###-##', '##.###.###/####-##']" />

I need to use directives , like this -

<input v-mask="['###.###.###-##', '##.###.###/####-##']" />

The problem is that I am working with SSR + VUE 3 , and it will not work .
Working with directives with vue 3 + SSR . it will give me erros .

It is that possible to work with components in vue 3 ?

@murilolivorato
Copy link
Author

nobody can help me ? =/

@murilolivorato
Copy link
Author

it does not works for vue 3 + SSR . =/ no answer

@joao-pedro-alves
Copy link

it does not works for vue 3 + SSR . =/ no answer

Unfortunatelly this package has been abandoned by its creator :/

@ilyaDegtyarenko
Copy link

Try this https://github.com/uNmAnNeR/imaskjs/tree/master/packages/vue-imask

@abdurrahmanseyidoglu
Copy link

You can detect if the window object is available (Which means we are on the client side) and render the input accordingly like This:

<template>
  <div v-if="isBrowser">
    <input v-mask="['###.###.###-##', '##.###.###/####-##']" />
  </div>
</template>

<script setup>
import { ref } from 'vue';

const isBrowser = ref(typeof window !== 'undefined');
</script>

Have a look at this as well: https://vuejs.org/guide/scaling-up/ssr.html#access-to-platform-specific-apis

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

4 participants