Jake2315
2 years ago
140
1
General

How to edit node modules?

Posted 2 years ago by Jake2315

So, I've pulled in a Vue datepicker with npm install vuejs-datepicker --save

I've successfully managed to output it in my view by configuring these 2 files:

App.js:

import Datepicker from 'vuejs-datepicker';

Vue.component('date-picker', Datepicker);

var app = new Vue({
    el: '#app'
});
<div class="form-group">
    <label for="arrival">Arrival</label>
    <date-picker id="arrival"></date-picker>
</div>

Now I wanted give the input (<date-picker></datepicker>) some Bootstrap styling by adding the form-control class attribute inside /node_modules/vuejs-datepicker/src/Datepicker.vue, like so:

 <input
        class="form-control"
        :type="inline ? 'hidden' : 'text'"
        :class="inputClass"
        :name="name"
        :id="id"
        @click="showCalendar()"
        :value="formattedValue"
        :placeholder="placeholder"
        :clear-button="clearButton"
        readonly>

Unfortunately, nothing has changed in my view.

What is the right way to edit these modules/packages?

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