admin管理员组文章数量:1430083
I made brand new app in vue and I want to add vuetify in the app as a framework. By running npm install vuetify --save
this mand it will add in the app but When I want to use it then there is no showing css button color while running the app.
The App.vue and the main.js files are :-
App.vue:-
<template>
<div id="app">
<v-btn color="success">Success</v-btn>
<v-btn color="error">Error</v-btn>
<v-btn color="warning">Warning</v-btn>
<v-btn color="info">Info</v-btn>
</div>
</template>
<script>
export default {
}
</script>
Main.js
import Vue from 'vue'
import App from './App.vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
Vue.use(Vuetify);
new Vue({
el: '#app',
render: h => h(App)
})
How can I run my app with CSS button coloring?
I made brand new app in vue and I want to add vuetify in the app as a framework. By running npm install vuetify --save
this mand it will add in the app but When I want to use it then there is no showing css button color while running the app.
The App.vue and the main.js files are :-
App.vue:-
<template>
<div id="app">
<v-btn color="success">Success</v-btn>
<v-btn color="error">Error</v-btn>
<v-btn color="warning">Warning</v-btn>
<v-btn color="info">Info</v-btn>
</div>
</template>
<script>
export default {
}
</script>
Main.js
import Vue from 'vue'
import App from './App.vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
Vue.use(Vuetify);
new Vue({
el: '#app',
render: h => h(App)
})
How can I run my app with CSS button coloring?
Share Improve this question edited Dec 5, 2018 at 6:43 Billal BEGUERADJ 22.9k45 gold badges123 silver badges140 bronze badges asked Aug 11, 2018 at 7:33 meenameena 1754 silver badges15 bronze badges2 Answers
Reset to default 3If you are using vue-cli 3 you can just run this mand; vue add vuetify
If you want to add it manually look at the documentation here:
Here you have an example, remember to add css-loader in webpack.
import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'
Vue.use(Vuetify)
new Vue({
el: '#app',
render: h => h(App)
})
EDIT: You should not change the question like that, think about that next time it will just confuse other people looking for help or trying to help you :)
About your new question, your template is wrong. You are missing <v-app>
<v-app>
<v-btn color="success">Success</v-btn>
<v-btn color="error">Error</v-btn>
<v-btn color="warning">Warning</v-btn>
<v-btn color="info">Info</v-btn>
<v-app>
Check out the red banner in the documentation here:
With Vue CLI 3, you can simply add it as you add any other package: vue add vuetify
.
Now if you run git diff
, you will see that everything is done for you behind the scenes:
You can see the modified files by the end of the installation process:
In the past, we were used to do that manually, and it was not always evident. This is a major improvement in Vue CLI 3.
本文标签: javascriptHow to add vuetify in the app from startingStack Overflow
版权声明:本文标题:javascript - How to add vuetify in the app from starting? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745526260a2661848.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论