I
I
Insanus2021-04-11 16:51:52
Vue.js
Insanus, 2021-04-11 16:51:52

Is it ok to use vanilla js and vue in the same project?

I took an order. The customer asked to make a project on vue 2.6 and use the swiper js slider. The swiper itself with vue only works with 3 versions. Told the client about it. We agreed that we should still use it, only write it with pure js. How normal is it to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-04-11
@Insanus

Only there (in swiper.js) is not Vue-cli, but just Vue .. In addition, there is a slightly reactive approach.
An interesting customer, maybe he also suggested an editor for the code. Let's say notepad++?
But is it ok to use vanilla js and vue in the same project? - it depends on how you are using Vue.
If like React, then yes, in general, it should be.
But, unlike React, Vue is a framework. This means that the framework itself dictates the internal structure of the application, the data flow, in fact, the architecture in the broadest sense of the word.
This imposes some restrictions on the one hand and gives freedom on the other. In any case, if you want to wedge yourself into a debugged environment with your own solutions. This must be done carefully and can be quite resource intensive and lead to unexpected consequences. Of course, integrating a simple slider shouldn't be a problem, but still. Well, if you write in Vue without using Vue-cli, then there are even fewer problems. On the other hand, it's much better (for the project's ecosystem) to rewrite it completely in the required version of Vue. This is a good and specific approach, but, again, resource-intensive. After that, you can even send your pull request to the swiper.js repository...
In any case, you had to tell him (the customer) that there would be more work (hemorrhoids) and take a break in the conversation and find a slider on the Internet that integrates completely with Vue 2.6 and offer it to the customer. Then the choice is his. In any case, he knows what to count on, and so he will stick to his point of view due to the lack of alternatives.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question