[Vuejs]-Getting the Text Mask Library to work with Vue – error: does not provide an export named 'default'

0👍

Found the answer in the github Issues:

const MaskedInput = window.vueTextMask.default
new Vue({
    el: '#app',
    components: { MaskedInput },
    data: {
        date: '',
        mask: [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/]
    }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-text-mask@6.1.2/dist/vueTextMask.min.js"></script>
<div id="app">
    Date:
    <masked-input v-model="date" :mask="mask" placeholder="__/__/____"></masked-input>
</div>

Leave a comment