I
I
Ibishka2019-12-21 01:16:13
Vue.js
Ibishka, 2019-12-21 01:16:13

What is the best way to implement the page?

Hey Ya. Installed vue cli. In the src folder, I created the pages folder, inside I created Home.vue, in it, between the template tag, I opened a div and inside I put the entire header section code of the home page, etc. Due to the fact that without a div, vue swears. So then I connected this file to App.vue. so the output is a div with id app inside a div without a class, just so that vue doesn’t bug out because of the header and section, etc. and inside my header section code, etc. So that's something mench does not like that I use a meaningless div. So how do you do all this, can you tell me? Ps the site is multi-page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Suha, 2019-12-21
@Ibishka

Each component has only one root element because of this and swears, but for good, the header is a separate component, the section is separate, the page is also a separate component.
Get something like this

// App.vue
<div id="app">
    <app-header/>
    <router-view/>
    <app-footer/>
</div>

And the pages will look something like this
<div id="page">
...page content

Well, I advise you to first read the dock on wu

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question