项目作者: daggerok

项目描述 :
Nuxt.js Vuetify Material Design Icons - How-too guide
高级语言:
项目地址: git://github.com/daggerok/nuxt-vuetify-material-design-icons-iconfont.git
创建时间: 2019-12-19T21:19:42Z
项目社区:https://github.com/daggerok/nuxt-vuetify-material-design-icons-iconfont

开源协议:MIT License

下载


nuxt-vuetify-material-design-icons-iconfont

Nuxt.js Vuetify Material Design Icons

initialize

  1. npm i -g create-nuxt-app
  2. create-nuxt-app my-app # choose Vuetify.js, axios, dotenv, pwa
  3. cd my-app/
  4. npm i -E material-design-icons-iconfont
  5. npm i -ED @nuxtjs/proxy css-loader svg-loader nuxt-webfontloader vue vuex axios

configure

nuxt.config.js

  1. export default {
  2. // ...skip other...
  3. css: [
  4. 'material-design-icons-iconfont/dist/material-design-icons.css',
  5. ],
  6. modules: [
  7. 'nuxt-webfontloader',
  8. ],
  9. webfontloader: {
  10. google: {
  11. // https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap
  12. families: ['Roboto:100,300,400,500,700,900&display=swap'],
  13. }
  14. },
  15. vuetify: {
  16. icons: {
  17. iconfont: 'mdiSvg' // || 'md' || 'fa' || 'fa4' || 'mdi', // default - only for display purposes
  18. },
  19. },
  20. };

layouts/default.vue

  1. <template>
  2. <v-app dark>
  3. <v-content>
  4. <v-container>
  5. <nuxt ></nuxt>
  6. </v-container>
  7. </v-content>
  8. <v-footer :fixed="fixed" app>
  9. <span>© me</span>
  10. </v-footer>
  11. </v-app>
  12. </template>

pages/index.vue

  1. <template>
  2. <v-layout>
  3. <v-flex class="text-center">
  4. <h1>Hello World!</h1>
  5. <v-btn>
  6. <v-icon>email</v-icon>
  7. </v-btn>
  8. </v-flex>
  9. </v-layout>
  10. </template>