Why do I need Vue? Whether (whether) to use it instead of jQuery?

It is only for the creation of a SPA?
Or the entire UI (you can safely cut it?)
June 10th 19 at 14:55
8 answers
June 10th 19 at 14:57
This is a different library (Yes, Vue is a library until you have added and Vue Vuex-router) with a different approach.
To use them together - only if you are not able to score the document.querySelector() or find / write an alternative jQuery plugin.

Here is a good article for understanding the fundamental difference between Vue and jQuery: https://habrahabr.ru/post/341798/
June 10th 19 at 14:59
First you do all this SPA historicity libraries, and then the PreRender'm stuck with the psych of all this crap on the server because your SEO has gone down the drain and the search engines power your site. This is a modern approach to web development.
that is, without the permission of backender I can't use VUE? - krista.Luettg commented on June 10th 19 at 15:02
Only a Sith deals in Absolutes. Vue can be used for components (module), so SSR does not have to be difficult. - Carter21 commented on June 10th 19 at 15:05
can , just the SEOs then you will be beaten. - Adriel51 commented on June 10th 19 at 15:08
and I can make him not beat me?))))) - krista.Luettg commented on June 10th 19 at 15:11
SSR on Vue Izzy is done) - rossie.Cro commented on June 10th 19 at 15:14
And if I'm stronger than SEOs? )) - Kameron_Hilpert34 commented on June 10th 19 at 15:17
For SEOs support the customer. - Jaqueline.Parisian commented on June 10th 19 at 15:20
most likely Yes - Kameron_Hilpert34 commented on June 10th 19 at 15:23
What historiska library to view? The whole point of view that 90% of the libraries tries not needed, everything is done easily. - elliott.Cartwrig commented on June 10th 19 at 15:26
this will be difficult to achieve. search engines don't much want to index dzhs - Greg.Hackett60 commented on June 10th 19 at 15:29
Well, there is https://ru.nuxtjs.org/ in the end. - Chelsea_Bauch31 commented on June 10th 19 at 15:32
So what's the point to use vue in those areas, where indexing by search engine? This is usually admin and some internal services - Winston.Huel16 commented on June 10th 19 at 15:35
,
SSR on Vue Izzy is done)

After rewriting the backend in js ) - Liliane_Kiehn99 commented on June 10th 19 at 15:38
why?
As there was some API in PHP though, at least for Python, and still is.

Just for Nginx, which previously gave index.html added express.js for render application. - rossie.Cro commented on June 10th 19 at 15:41
turns out , another layer? Express will, in turn, refer to API for data pages? Doesn't seem that easy. - Liliane_Kiehn99 commented on June 10th 19 at 15:44
Express just renders html, application code, and is isomorphic to the one and to work on the client and rendering on the server.

The only one on the server not all hooks work and it is necessary to remember that there is no window. - rossie.Cro commented on June 10th 19 at 15:47
June 10th 19 at 15:01
possible, but not necessary

in the same way as other similar technology, is nothing more than messy html code, which torment to wrestle in a strange unconvincing logic, and the idea arose from the desire to give uneducated coders the opportunity to add some interactivity on a web page

the General is not too high the level of those who calls itself the front-end developers, these crutches have become a panacea for those who do not know how to program myself

with jquery it is possible to keep the html clean and as light as possible, and all programming on the client to do in just one js file, and business logic to be organized so that it will be easy to move to any other project, and nothing prevents you to build your virtual dom
with jquery it is possible to keep the html clean and as light as possible, and all programming on the client to do in just one js file


Yes, you say, well, make one file of jquery logic interface "drive.google.com" or amocrm CRM system or similar. I would love to see your clean code. - krista.Luettg commented on June 10th 19 at 15:04
stupid example on a completely normal comment. - Carter21 commented on June 10th 19 at 15:07
already did :) - Adriel51 commented on June 10th 19 at 15:10
Actually, such technology has gone from facebook and google. Is there work uneducated coders?

with jquery it is possible to keep the html clean and as light as possible

Only then js is not clean and easy. And files have to be stored and named in accordance with the html files (under the component approach). And in any case, to implement the same tasks that require such things, will have to clutter up the html code a bunch of classes, additional elements and attributes. With the use of Vue templates Vice versa cleaner work.
and all programming on the client to do in just one js file

Well, it is, however, not the merit of jQuery. - krista.Luettg commented on June 10th 19 at 15:13
thank God, not all the best is created in Google and Facebook :) there are plenty of other places where talented people work and create things talented - so: do not make yourself an idol :) that is all a matter of your personal faith in your chances to accidentally meet such a talented person on the Internet

Only then js is not clean and easy.

why not? that will help you to prevent, if you use the same javascript?
And files have to be stored and named in accordance with the html files

which files you want to keep, except the html pages?

to implement the same tasks that require such things, will have to clutter up the html code a bunch of classes, additional elements and attributes

no need to clutter the html attributes and elements have the backend technology is not polluting :)
css classes should not be used to bind functionality, css is purely a design tool, and design in different projects are different, again, the backend does not

With the use of Vue templates Vice versa cleaner work.

show me an example template vue with complex functionality, in which there is no code not related to html and design css :) about the localization of 3-4 languages or use the same templates with the same business logic in other projects don't even ask )) - rossie.Cro commented on June 10th 19 at 15:16
if not through classes, not through the attributes as you select the selectors? - Kameron_Hilpert34 commented on June 10th 19 at 15:19
through a combination of tags in the template, but the templates we have are not what is usually all I use when writing code manually, we your code generated

a css class can also be used in this combination, but only if it does not apply to a specific project or design a specific project

all the functionality is bound to the id components, but not directly, but indirectly, to the id in javascript code not written - Jaqueline.Parisian commented on June 10th 19 at 15:22
if not difficult example? (code redo if KOMM secret) just wonder - Kameron_Hilpert34 commented on June 10th 19 at 15:25
Yes, actually the whole technology is under lock and key, and because of the legal complexities likely there to stay, and he javascript code you will tell nothing, it is practically no different from the usual, the difference is in the application architecture and data

but in fact it's the same thing that makes the backend model of the entire application in the database, and in this case it is in json; once you have a holistic model of the whole application, you have full access to any part of your application, and no html, you do not need to comply with the terms of the business logic or to make the calculations

the concept is radically different from those now popular in the people because the people are very much concerned about complete control over everything that happens inside the application and would not part with him :) - elliott.Cartwrig commented on June 10th 19 at 15:28
not still did not understand without an example in any way, and it will not(I don't blame you, everyone understands), model model. but the selector you have to knock so still for frameworks)
But thanks for the thought - Greg.Hackett60 commented on June 10th 19 at 15:31
the example is a presentation of 30 slides, and not all of them get it on a freebie in question :)
people love hard and difficult to work, it will not change

the selectors not to knock you, but a single method for which you specify a set of selectors for each template, on which any project need about 2 dozen more with html you work, you work for jquery, and you work only with json and javascript - Chelsea_Bauch31 commented on June 10th 19 at 15:34
okay but if you knock on the attachments and it changes? like all vague - Winston.Huel16 commented on June 10th 19 at 15:37
, jq is the difference? here and there indicated any was ID, where does the jq in General, it lists the classes auger cascade Kidsnike or whatever - Liliane_Kiehn99 commented on June 10th 19 at 15:40
,
thank God, not all the best is created in Google and Facebook

But only the best gets spread and further development.

why not? that will help you to prevent, if you use the same javascript?

Use complex selectors with bulky structure.

which files you want to keep, except the html pages?

js and css. That applies to this component.

no need to clutter the html attributes and elements have the backend technology is not polluting :)
css classes should not be used to bind functionality, css is purely a design tool, and design in different projects are different, again, the backend does not

And what's the backend? And who said that the classes necessarily and exclusively for css? A class describes what that element is, its features. And how do you think the backend should pass the data to js (for example, time scheduled events in some calendars)?

show me an example template vue with complex functionality, in which there is no code not related to html and design css :)

I do not understand, why do I need vue, if you do not use "any code not related to html and design css".

Here is an example of the template on the vue
Used ready component Twitter Bootstrap. No need to paint the entire structure and all classes.
<template>
 <b-form @submit.prevent="submit_form">
 <b-form-group label="Name" :invalid-feedback="'Enter name'">
 <b-form-input type="text" id="name" name="name" v-model="artist.name">
</b-form-input></b-form-group>

<b-form-group>
 <b-button variant="primary" type="submit">Save</b-button>
</b-form-group>
</b form>
</template>


Then this form can be easily connected to any destination:
<template>
the <div>
 <h2 class="page-header">
 <router-link-to="{name: 'artists'}">Artists</router-link>
 <span class="text-muted">/</span>
Edit
</h2>

 <artist form :artist="artist" @submit-form="update_artist"></artist-form>
</div>
</template>

- rossie.Cro commented on June 10th 19 at 15:43
,
where would this spread and development, if not invested in marketing millions of dollars? :)

make your structure and selectors is simple - at all desire can't understand how the selector input can be complex

what's stopping you to store all your components in one file?
and the answer to counter-question: make your components simple

the backend has a competent structure, where the data representation and data processing are completely separate layers, nothing prevents you to ease your life and to use the same structure for front-end

css classes is the layer representation data, so they should not be used for data processing, this does not mean that you have no right to organize the chaos wherever you are, but in complex structures and projects, people usually prefer predictable order, especially for the binding functionality of each interface element has a unique id, just as it does in the database, and the data is transferred in json, and to use these in css, that is the id of the elements to assign them styles, it is also not necessary, they have to stay for functionality

if you keep everything separate, then you can easily replace, e.g., the design or the localization of your application, as is done in any engine

imagine that you, like on the backend, no html, only elements of the application - it is possible that you will visit the enlightenment - Liliane_Kiehn99 commented on June 10th 19 at 15:46
, jq in this case ensures the cross-browser compatibility
if there is another tool that does the same thing, then we can easily change to the new jq

the access to the building dictates the methods to access the elements in the case of jq are selectors
within the same template, you need a maximum of one css class that defines the template and then the path of the selector tag to the item, which can change their value or to the event browser

give an example of nesting that is causing you issues - rossie.Cro commented on June 10th 19 at 15:49
you have condition - design of already developed and this is not bootstrapping, your website needs to work for 8 European languages

to="{name: 'artists'}" and :artist="artist" @submit-form="update_artist" I call garbage
tomorrow you will have the project for the sale of tights - you can use the same templates and code? - nikita.Stracke commented on June 10th 19 at 15:52
was utsal div and span with articles - gust commented on June 10th 19 at 15:55
div and span with articles is only the tags that you actually can replace some diva or spani

give an example of a nested content that causes you difficulties
for example, the information about the product - what part of it needs to be nested, this nesting has created problems - Pedro65 commented on June 10th 19 at 15:58
if we do not touch classes that knock through tags and therefore very important) not saying you're wrong but don't understand) well I won't waste your time)) - Liliane_Kiehn99 commented on June 10th 19 at 16:01
tags are important only in the context of the item template in which you want to reach, that is, say, a product description - then you need item description, but if you need to hide all the goods, you will need to reach the container which contains the information about the product element is the container, and the pattern one or two nested diva, and you can easily doctoriales to the second via .div1_class div

the template engine places the item template of the description of goods inside the container template, you have two elements, the container and product description inside it, there can add a template name, say, any h3, and the template images of the product, that is img, for a total of three nested element - Pedro65 commented on June 10th 19 at 16:04
,
tomorrow you will have the project for the sale of tights - you can use the same templates and code?

Then I'll use something like spree. Why would I want to use the code music library to store?
If we are talking about the same type of template projects, I do not argue, it is better to use some kind of universal solution. - krista.Luettg commented on June 10th 19 at 16:07
about it and speech that you have to write again, although no clear need for this, not to mention drastically reducing development time

in the case of multilingual you still have multiple versions of the same "templates" tag which defines the entire content, even with two languages - it is a headache, that is what is called a template, and the template can not be called - Pedro65 commented on June 10th 19 at 16:10
June 10th 19 at 15:03
The fundamental difference is in the approach. JQuery is a library of the philosophy of which HTML JS separately separately. After loading the JS on different DOM elements "hung" event handlers. In the case of complex SPA can be broken down from what and in what sequence will work if we now change this processor won't break any other? Plus the speed of working with the DOM directly is low and load the JS engine of the browser.
Vue is a reactive framework. Its essence is that we associate certain variables with DOM elements and append handlers of the changes in these variables. Does the rest framework, he tracks changes variables and response handlers. Moreover, manipulation with DOM made on the internal copy in memory and in the real DOM only displays the diffs between it and the copy. Code more compact and clearer especially in the case of "heavy" SPA. However, we must remember that the HTML generated by the JS and then there are the problems with indexing by search engines.
The result is a fundamentally different approaches to the development of frontend. Knowledge in JQuery little help in the development of Vue.
nothing prevents you to organize your handlers in such a way as not to puzzle over how they work :) I do not break, although the functionality of the SPA that we make are extremely complex due to the very demanding business

about the speed and browser engine - it's not even funny, especially since no real evidence of problems with the speed on the website to show you will not as well as they are unable to demonstrate to me nor my colleagues nor our testers

Vue and others like them just tie all the functionality to the html and make it a real dump, and to verify this, simply open any template

nothing prevents you to create your own virtual model and produce handling the inside of this model, it is enough to javascript, and to display the differences - the same jquery, and again, easy to avoid indexing problems

Vue and the rest of the zoo you can not learn if you know javascript and jquery. - krista.Luettg commented on June 10th 19 at 15:06
June 10th 19 at 15:05
Most importantly, why modern frameworks -- reuse of complex components. For example, any combined entry field amount including VAT-10% VAT-18%, where is the verification of amounts and these 2 VAT for consistency. You can write on anything, but React and Vie ease the use of such a field many times in different parts of the code.

Vue worse than the React+MobX. There are scenarios that at the vue does not do and MobX -- easily;
Vue worse than the React+MobX. There are scenarios that at the vue does not do and MobX -- easily;

Can you give examples of when Vue+Vuex worse React+MobX? And, if possible, it would be interesting examples where the Vue is worse than React in terms of code (for example, when you can implement both, but reacte much easier). - krista.Luettg commented on June 10th 19 at 15:08
join issue. right after I wonder ) - Carter21 commented on June 10th 19 at 15:11
+1, also very interesting - Adriel51 commented on June 10th 19 at 15:14
well, let's show an example - krista.Luettg commented on June 10th 19 at 15:17
you forget that the vue and the react is the same javascript that is all you do with these frameworks you can do in plain javascript or on the private framework

in plain javascript makes any scenario, because it's not in the language or framework you are using, and in your personal capacity for competent visualization and structuring of data with which you work

with a strong desire and vue with the react can handle complex scenarios, but the truth, not with those classes and templates for which they are used - rossie.Cro commented on June 10th 19 at 15:20
June 10th 19 at 15:07
What's more, they still can be combined with KF :) They each other do not interfere.
in fact, Yes, I mean, OI is the meaning of using VUE for sliders and other things(and work to do to learn) - krista.Luettg commented on June 10th 19 at 15:10
Vue is an interesting and smart tool, in any case, if you have a desire to try it is just fine. Start small, and then you will see what exactly you will be coming, might even want the whole structure to translate for him. - Carter21 commented on June 10th 19 at 15:13
If you have two slider and Potapchik — not worth it.
If there is a no calculator, it is already possible to do in vue, and along the way, and the rest of the front too. Here is from jQuery can be waived. If the skill is enough. - Adriel51 commented on June 10th 19 at 15:16
just start with something, and we only have the sliders, Yes poputchiki......Say you do a great some of verstaile SPA? and you need to do in creating the SPA 7 there I looked 8-0% working with databases so? if you can describe the steps please - krista.Luettg commented on June 10th 19 at 15:19
So only autists do - rossie.Cro commented on June 10th 19 at 15:22
Even as interfere with each other, this is the worst combination that can be. A bunch ISU due to conflicts in the HOUSE. - Kameron_Hilpert34 commented on June 10th 19 at 15:25
, view for sliders? Into? My God, what horror. - Jaqueline.Parisian commented on June 10th 19 at 15:28
why do I need vue, if all you can do in javascript + jquery ? - Kameron_Hilpert34 commented on June 10th 19 at 15:31
June 10th 19 at 15:09
It is possible and necessary.
Yes, if anything better and easier can not think of - krista.Luettg commented on June 10th 19 at 15:12
June 10th 19 at 15:11
Everything in jQuery is now possible to do in pure JS and not to pull extra 100KB.
Vue (React, Angular) allow us to declaratively describe the logic of the presentation and work with the DOM directly.

Find more questions by tags JavaScriptVue.js