M
M
Maxim Vlasov2021-12-02 15:09:06
Vue.js
Maxim Vlasov, 2021-12-02 15:09:06

How to set separate style sets for parent components in Vue?

There are 2 ready-made layouts: the main site and the administrative section. You need to set your own styles for each part.
The structure is as follows:

App
-Site
--Index
--About
-Admin
--Dashboard

Where App,Site,Admin are parent components with route-view. Used by vue-router.
How to load styles for Site and Admin separately? Given that there are multiple css files for each section.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-12-02
@Aleksandr-JS-Developer

In components:

<template>...</template>
<script>...</script>

<style scoped src="./file1.css"></style>
<style scoped lang="scss" src="./file2.scss"></style>
<style scoped>
  .selector: { color: red; }
</style>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question