vue-datetime icon indicating copy to clipboard operation
vue-datetime copied to clipboard

Method "format" has already been defined as a prop.

Open Zenemig opened this issue 6 years ago • 1 comments

Versions

  • vue: 2.6.10
  • vue-datetime: 1.0.0-beta.10
  • luxon: 1.16.0

Description

When using the library I get two console error messages:

[Vue warn]: Method "format" has already been defined as a prop.

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "format"

Steps To Reproduce

I am using the component like this:

            <datetime
              v-validate="'required'"
              v-model="date"
              :format="dateFormat"
              use12-hour
              type="date"
              name="fecha"
              input-id="siniestro-auto_ubicacion-siniestro_fecha_input"
              hidden-name="fecha" />

And dateFormat is defined on my data object like this:

dateFormat: luxon.DateTime.DATE_MED

Zenemig avatar Jun 17 '19 16:06 Zenemig

The problem is because the method already exists in your project. Maybe in a mixin configuration.

j1cs avatar Jul 06 '20 23:07 j1cs