D
D
Dmi3ii2018-04-02 11:51:27
Vue.js
Dmi3ii, 2018-04-02 11:51:27

How to change the variables of the imported component and get to them from the children?

Good afternoon.
I import datepicker from China. Imported. Works. Only hieroglyphs interfere. If you register the local object in the child component, then the translation works. How to register it globally and refer to it?
main.js

import VueDatepickerLocal from "vue-datepicker-local";
Vue.use(VueDatepickerLocal);
new Vue({
  el: "#app",
  router,
  store,
  template: "<App/>",
  components: {
    App
  },
  data: {
    local: { // <------ НЕ РАБОТАЕТ ---------<<<
      dow: 0, // Sunday is the first day of the week
      hourTip: "Select Hour", // tip of select hour
      minuteTip: "Select Minute", // tip of select minute
      secondTip: "Select Second", // tip of select second
      yearSuffix: "", // suffix of head year
      monthsHead: "January_February_March_April_May_June_July_August_September_October_November_December".split(
        "_"
      ), // months of head
      months: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), // months of panel
      weeks: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), // weeks,
      cancelTip: "cancel",
      submitTip: "confirm"
    }
  }

info.vue
<vue-datepicker-local v-model="time" :local="local" /> // как добраться до объект local обвяленного в main.js???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
fl3nkey, 2018-04-02
@Dmi3ii

$root.local

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question