Answer the question
In order to leave comments, you need to log in
How to connect a component to vuetify with its own css so that it only affects the component itself, and not external html?
Hello.
Please tell me the solution to the problem.
Situation:
I am developing a component using vue + vuetify, which should be included in a legacy html page. There was a difficulty with connecting the css of vuetify itself to this component.
What I tried:
Option 1.
css is added in the plugin using the line:
import 'vuetify/src/stylus/app.styl'
The element is used in the root template, like this:
<template>
<v-app>
<h2>Test</h2>
<v-layout row>
<v-btn color="red">TestButton</v-btn>
<v-btn color="primary">TestButton2</v-btn>
</v-layout>
</v-app>
</template>
<style scoped></style>
<style scoped>
@import url('../node_modules/vuetify/dist/vuetify.min.css');
</style>
<template>
<v-app>
<h2>Test</h2>
<v-layout row>
<v-btn color="red">TestButton</v-btn>
<v-btn color="primary">TestButton2</v-btn>
</v-layout>
</v-app>
</template>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question