coder_uzb
2 years ago
9
1
Vue

How can I set datepicker value when I changed date?

Posted 2 years ago by coder_uzb

Hi guys. I have form about one person, and I use in component datepicker plugin.When I change date value my field does not update.But when I use without datepicker plugin everything is working. My code.

 <input type="text"  name="birthdate" v-model="form.birthdate" id="js-personal-datepicker" class="input rounded personal__input personal__input--date">
export default {
        data() {
            return {
                form: {},
                errors: {}
            }
        },

    mounted(){
            this.getProfileData()
            this.$nextTick(function(){
                // $("#js-personal-datepicker").mask("99/99/9999", {autoclear: false});
                $('input[name=birthdate]').datepicker();
            })
        },

    methods: {
            getProfileData() {
                var _ = this
                axios.get('/profile')
                    .then(function(response) {
                        _.$set(_.$data, 'form', response.data.form)
                        console.log(response)
                    })
            },
    }

Please sign in or create an account to participate in this conversation.