[Vuejs]-How to make dynamic props for element UI

0👍

I’m not sure if I understand you correctly, but you can change your pickerOptions to be a computed data, like here: https://jsfiddle.net/Lczj0ndp/1/

    data() {
      return { dynamicValue: '' };
    }
    computed: {
      pickerOptions1() {
        return { 
          someOption: this.dynamicValue,
          ...
        }
      }

and then you can make one or more of your options dynamic.

More about computed data you can read here.

0👍

Fixed it with:

        computed: {
          combinedPickerOptions() {
              return {
                  firstDayOfWeek: 1,
                  ...this.pickerOptions,
              };
          },
       },

Solution is the spread operator. Now i can set “firstDayOfWeek” as default and set more options if need.

Leave a comment