N
N
nezzard2020-05-09 13:01:56
Vue.js
nezzard, 2020-05-09 13:01:56

What is the advantage of Vue composition API?

Good afternoon, I'm trying to find intelligible information about what is the advantage of the Vue composition api in vue 3, but I can't find it.
In vue 2, everything is somehow convenient and clear, everything is structured on the shelves, methods to methods, calculated to calculated, in vue 3 all this is in one setup, you need to import computed, ref, etc. prescribe additional functions, return all functions through return.
So far, I see only hemorrhoids in all this, if someone has already figured it out, please tell me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marsdenden, 2020-05-09
@nezzard

Personally, I liked two things - the separation of layout and logic and code reuse. I have two components in my combat project, one of which had to be divided into three, and the second one is just huge - both a sprawling template and just an endless footcloth script. I'll wait for a stable release of vue3 and will remake it on composition api.
Another plus that I found for myself is normal debugging. For some reason, my devtools debugger has a one-line offset in the code that is in .vue and works perfectly fine with pure .js files. And console.log also lies on 1 line in the first case and accurately displays the line number in the second.
Well, I recommend watching https://youtu.be/v6AVfIupNB8 and https://youtu.be/Ix8wcwrnPns

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question