simplesmiler / vue-focus

A reusable focus directive for reusable Vue.js components
MIT License
404 stars 40 forks source link

Support Vue 2.0 #7

Closed simplesmiler closed 8 years ago

simplesmiler commented 8 years ago

The 2.0 release of Vue draws near, and vue-focus should follow.

Besides internal reworkings, 2.0 will require some changes to vue-focus API. Namely, with two-way directives now gone, v-focus-model becomes obsolete, and should be replaced with something like:

<input v-focus="expr" @focus="expr = true" @blur="expr = false">
simplesmiler commented 8 years ago

The v-focus-auto will probably be gone too, because v-focus="true" does the same while being more flexible.

reinerBa commented 8 years ago

Hi there, is the vue-focus v2 still compatible with vue 1 or may i only use it with vue 2?

simplesmiler commented 8 years ago

No. With directives API changing in Vue 2.0 there is no good way to support 1.x and 2.x with a single codebase.

Although you will still be able to npm install vue-focus@^1.0 to get Vue 1 compatible version.

PrimozRome commented 8 years ago

@simplesmiler if I want to use this with Vue 2.0 do I need to install the 2.0 brach? Is it available on npm already?

simplesmiler commented 8 years ago

@PrimozRome it is on npm as npm install vue-focus@next. It will complain about peer dependency because Vue 2.0 is not released yet, but should work just fine. Once Vue 2.0 goes live, npm install vue-focus will install 2.0-compatible version.

simplesmiler commented 8 years ago

Published 2.0, see release notes.