beholdr / maska

Simple zero-dependency input mask for Vue, Svelte, Alpine.js and vanilla JS.

Home Page:https://beholdr.github.io/maska/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Input get a raw value

alloself opened this issue · comments

Describe the bug

if there is a component that displays children vue-router and passes this data through provide , then modelValue is displayed as raw

Steps to reproduce

need to create a route that contains children routes and pass data from parent to child via provide , and in the child a v-model with an input

parent component:


<template>
<div>
      <router-view />
</div>
</template>
<script setup>
import { ref, provide } from 'vue';

const data = ref({
  phone: '',
  code: '',
});
provide('data', data);
</script>

childrent component:

<template>
  <input
          ref="phoneInput"
          v-model="authData.phone"
          name="phone"
   />
</template>
<script setup>

const authData = inject('data');

</script>

steps to reproduce - we get to the page with the input and enter the value, then go to any other children page and return back using software navigation

I don't see maska usage in your code. Please provide minimal working example in some online sandbox or repo.

I don't see maska usage in your code. Please provide minimal working example in some online sandbox or repo.

yes,u right,sorry , I attach links to codesandbox and video in jam:

  1. https://codesandbox.io/s/pensive-mclaren-5gpvvf
  2. https://jam.dev/c/dcb56576-db0f-4e8a-b1a3-fa5f4e14bbcd

@beholdr