Vue2-datepicker: Only show popup on calendar icon click broke

Created on 26 Aug 2019  路  3Comments  路  Source: mengxiong10/vue2-datepicker

Hello!

This issue was already solved in #215 , I tried that method with the last version of vue2-datepicker and it didn't worked. I downgraded to v2.6.3 version and it worked with the same code. I personally don't need this, it's just an observation.

Thank you!

feature

Most helpful comment

Control the opening of the popup by open
It'll be opened when the click is not input element.

<date-picker :open="open"  @close="open = false"  @click.native="handleClick" />
export default {
  data() {
    return {
      open: false,
    };
  },
  methods: {
    handleClick(evt) {
      if (evt.target.tagName !== 'INPUT') {
        this.open = true;
      }
    },
  },
};


All 3 comments

It's a problem to config how to show the popup.
I'll add the featrue to next version.

v3.0.0 add prop open to control the state of popup.

Control the opening of the popup by open
It'll be opened when the click is not input element.

<date-picker :open="open"  @close="open = false"  @click.native="handleClick" />
export default {
  data() {
    return {
      open: false,
    };
  },
  methods: {
    handleClick(evt) {
      if (evt.target.tagName !== 'INPUT') {
        this.open = true;
      }
    },
  },
};


Was this page helpful?
0 / 5 - 0 ratings

Related issues

kugatsu765 picture kugatsu765  路  3Comments

colq2 picture colq2  路  4Comments

ajithsimon picture ajithsimon  路  4Comments

Raiondesu picture Raiondesu  路  4Comments

burzum picture burzum  路  3Comments