A
A
Albert Kazan2019-11-13 15:52:37
Vue.js
Albert Kazan, 2019-11-13 15:52:37

How to make component assembly from *.vue file?

I decided to switch to this, because most of the necessary features are not provided through the CDN, but only through import and all that. Previously, I didn’t use any webpack assemblers or something like that, because I didn’t develop the frontend.
And I can't even find a normal guide. I want to transfer my components and so on to .vue files in parts. But I don't understand how. I already have Node and npm. I tried to do it through vue-cli (most of the lessons are outdated for the new version), but there the assembly goes under some kind of vue-cli that is assembled by itself. In short, I did not understand.
I'm a little better. To collect all the vue parts into one "independent" js file and then connect it to the site.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Albert Kazan, 2019-11-13
@Farrien

In main.js, it turns out that it was only necessary to write it like this, while deleting import Vue from 'vue'and finally the component in a separate part.

import hello from './components/HelloWorld.vue';
Vue.component('hello-world', hello)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question