Giter VIP home page Giter VIP logo

vuetify-module's Introduction

nuxt-tailwindcss

npm downloads npm version circle ci coverage License

Vuetify 2 module for Nuxt 2

Nuxt 3

Looking for a Nuxt 3 solution? Try out:

Infos

Setup

  1. Add @nuxtjs/vuetify dependency to your project
yarn add --dev @nuxtjs/vuetify # or npm install --save-dev @nuxtjs/vuetify
  1. Add @nuxtjs/vuetify to the buildModules section of nuxt.config.js

โš ๏ธ If you are using Nuxt < 2.9.0, use modules instead.

{
  buildModules: [
    // Simple usage
    '@nuxtjs/vuetify',

    // With options
    ['@nuxtjs/vuetify', { /* module options */ }]
  ]
}

Using top level options

{
  buildModules: [
    '@nuxtjs/vuetify'
  ],
  vuetify: {
    /* module options */
  }
}

Options

customVariables

  • Type: Array
    • Items: String
  • Default: []

Provide a way to customize Vuetify SASS variables.
Only works with tree-shaking.

Usage example :

// assets/variables.scss

// Variables you want to modify
$btn-border-radius: 0px;

// If you need to extend Vuetify SASS lists
$material-light: ( cards: blue );

@import '~vuetify/src/styles/styles.sass';
// nuxt.config.js
export default {
  vuetify: {
    customVariables: ['~/assets/variables.scss']
  }
}

The list of customizable variables can be found by looking at the files here.

defaultAssets

  • Type: Object or Boolean
  • Default:
{
  font: {
    family: 'Roboto' 
  },
  icons: 'mdi'
}

By default, automatically handle Roboto font & Material Design Icons.

These assets are handled automatically by default to provide a zero-configuration which let you play directly with Vuetify.

defaultAssets.font.family automatically adds the specified font (default Roboto) stylesheet from official google fonts to load the font with font-display: swap. If you have nuxt-webfontloader in your modules, it will use it automatically.

defaultAssets.font.size allows you to specify the root font size in your application.

โš ๏ธ If you choose a custom font family (i.e. not Roboto), it will automatically override Vuetify SASS variables ($body-font-family & font-size-root), but you will need tree-shaking to be enabled to have them correctly applied.

defaultAssets.icons automatically adds the icons stylesheet from a CDN to load all the icons (not optimized for production).
Here are the accepted values for this option :

Value Icons
'mdi' (default) Material Designs Icons (CDN)
'md' Material Icons (CDN)
'fa' Font Awesome 5 (CDN)
'fa4' Font Awesome 4 (CDN)
false Disable auto add of the icons stylesheet

This option (if not set to false) will automatically override icons.iconfont Vuetify option so that Vuetify components use these icons.

Please refer to Vuetify Icons documentation for more information about icons, notably for using only bunch of SVG icons instead of including all icons in your app.

You can also set the whole defaultAssets option to false to prevent any automatic add of these two assets. You can read more about adding your own assets in the Offline applications section.

optionsPath

  • Type: String

Location of the Vuetify options that will be passed to Vuetify.

This file will be compiled by webpack, which means you'll benefit fast hot reload when changing these options, but also be able to use TypeScript without being forced to use TypeScript runtime.

// nuxt.config.js
export default {
  vuetify: {
    optionsPath: './vuetify.options.js'
  }
}

Note that you can also use Directory Aliases like '~/path/to/option.js'

All vuetify options are supported, it includes :

// vuetify.options.js
export default {
  breakpoint: {},
  icons: {},
  lang: {},
  rtl: true,
  theme: {}
}

Notice that passing the Vuetify options directly to Module options is still supported, but it will trigger Nuxt entire rebuild if options are changed.

If you need to access Nuxt context within the options file, you need to export a function instead :

// vuetify.options.js
export default function ({ app }) {
  return {
    lang: {
      t: (key, ...params) => app.i18n.t(key, params)
    }
  }
}

treeShake

  • Type: Object or Boolean
  • Default: process.env.NODE_ENV === 'production'

Uses vuetify-loader to enable automatic tree-shaking. Enabled only for production by default.

You can set object as a set of options to manually import Vuetify modules globally:

Key Type Value
components string[] array of name of Vuetify components to import globally
directives string[] array of name of Vuetify directives to import globally
loaderOptions function loader option which applies to VuetifyLoaderPlugin
transitions string[] array of name of Vuetify transitions to import globally

TypeScript

If you're using TypeScript, you'll need to add @nuxtjs/vuetify in your compilerOptions of your tsconfig.json :

{
  "compilerOptions": {
    "types": [
      "@types/node",
      "@nuxt/vue-app",
      "@nuxtjs/vuetify"
    ]
  }
}

You'll then be able to have autocompletion in Context (ctx.$vuetify) and Vue instances (this.$vuetify).

Offline applications

If you're building an application that will need to work offline (more likely a PWA), you will need to bundle your fonts and icons in your app instead of using online resources.

It means you must set defaultAssets option to false.

For fonts, you may leverage CSS @font-face rule with local path of your fonts. You may find the google webfonts helper site useful for generating @font-face rules and sourcing replacement files for the default CDNs.

For icons, you can either use the same way than above, or leverage tree-shaken SVG libraries like Material Design Icons SVG or Font Awesome 5 SVG.

Migration Guide from Vuetify 1.5.x

You'll find a step by step guide to upgrade from 1.5.x to 2.x here

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using yarn dev or npm run dev

License

MIT License

Copyright (c) Nuxt Community

vuetify-module's People

Contributors

ackushiw avatar aldarund avatar alexjoverm avatar atinux avatar beijaflor avatar bengineer19 avatar benyou1969 avatar clarkdo avatar dependabot[bot] avatar dholladay avatar gu3 avatar hareku avatar harlan-zw avatar iliyazelenko avatar kaelwd avatar kevinmarrec avatar micheldenegri avatar mrjmpl3 avatar mseele avatar nickmessing avatar novobit-whellmann avatar renovate-bot avatar renovate[bot] avatar stummej avatar yihao-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuetify-module's Issues

I think treeShake not work....

in nuxtjs/vuetify 1.0.0

in nuxt.config.js

vuetify: {
treeShake: true,
theme: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3
}
}

when
yarn build and yarn start

vuetify component showing blink..
I think vuetify-loader not working..
check this..

my package.json is
"private": true,
"scripts": {
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "yarn lint",
"dev": "nuxt",
"build": "nuxt build",
"start": "cross-env NODE_ENV=production nuxt start",
"generate": "nuxt generate"
},
"dependencies": {
"@nuxtjs/axios": "^5.5.4",
"@nuxtjs/pwa": "^3.0.0-beta.16",
"@nuxtjs/vuetify": "^1.0.0",
"cross-env": "^5.2.0",
"nuxt": "^2.8.1"
},
"devDependencies": {
"@nuxtjs/eslint-config": "^0.0.1",
"@nuxtjs/eslint-module": "^0.0.1",
"babel-eslint": "^10.0.1",
"eslint": "^5.15.1",
"eslint-config-standard": ">=12.0.0",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-jest": ">=22.3.0",
"eslint-plugin-node": ">=8.0.1",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.2",
"nodemon": "^1.18.9",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2"
}

Form password matching, does not work anymore!

When adding form rules the rules for matching password use to work with the previous vuetify that came pre installed in Nuxt. However I think this module is WAY better as far as loading time but the same rules now break my app. Here is my password word fields...

<v-text-field
v-model="password"
:rules="passwordRules"
:append-icon="show ? 'visibility_off' : 'visibility'"
:type="show ? 'text' : 'password'"
label="Password"
placeholder="Enter password"
required
tile
@click:append="show = !show"
/>
<v-text-field
v-model="passwordConfirmation"
:rules="passwordRules"
:append-icon="show ? 'visibility_off' : 'visibility'"
:type="show ? 'text' : 'password'"
label="Password"
placeholder="Confirm Password"
required
tile
@click:append="show = !show"
/>

Here is my rules:
data: () => ({
value: null,
show: false,
dialog: true,
title: 'Enter new password',
update: ' Reset Password',
isFormValid: true,
password: '',
passwordConfirmation: '',
passwordRules: [
password => !!password || 'Password is required',
password => password.length >= 6 || 'Password must be at least 6 characters',
confirmation => confirmation === this.password || 'Passwords must match'
]
})

these two work as expected:
password => !!password || 'Password is required',
password => password.length >= 6 || 'Password must be at least 6 characters',

this works works fine in previous installs:
confirmation => confirmation === this.password || 'Passwords must match'

But now errors. console says:

TypeError: Cannot read property 'password' of undefined
at passwordRules (_id.1c0d67116b3b8744ad5f.hot-update.js:120)
at VueComponent.validate (vendors.app.js:89420)
at VueComponent.beforeMount (vendors.app.js:89389)
at invokeWithErrorHandling (commons.app.js:11680)
at callHook (commons.app.js:14034)
at mountComponent (commons.app.js:13858)
at VueComponent.push../node_modules/vue/dist/vue.runtime.esm.js.Vue.$mount (commons.app.js:18226)
at init (commons.app.js:12942)
at createComponent (commons.app.js:15789)
at createElm (commons.app.js:15736)

How to get this to work again??

$vuetify is not present in context

Thanks for your great work. $vuetify is not present in nuxt context. if we try to see in mounted hook, it's working

mounted() {
    console.log(this.$vuetify);
}

if we want to see in plugin, $vuetify is undefined

export default function({$vuetify}) {
  console.log($vuetify);
}

or

export default function({app}) {
  console.log(app.$vuetify);
}

if we check all context, $vuetify is not there

export default function(cxt) {
  console.log(cxt);
}

update auto load icon css to latest version

if (options.defaultAssets.icons) {
  this.options.head.link.push({
    rel: 'stylesheet',
    type: 'text/css',
    href: 'https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css'
  })
}

current css version is old.
3.8.95 is latest version.

How to upgrade to latest version of vuetify?

Module version
The version of the module you're using.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Nuxt generate uses default theme colors ignoring colors defined in config

vuetify-module: 1.0.0

nuxt.config.js:

vuetify: {
    treeShake: true,
    customVariables: ['~/src/assets/style/variables.scss'],
    icons: {
      iconfont: 'mdi'
    },
    theme: {
      dark: true,
      themes: {
        dark: {
          headerAndFooterColor: colors.blue.darken3,
          cardColor: colors.blueGrey.darken4,
          primary: colors.teal.lighten3 // blue.darken2
        },
        light: {
          headerAndFooterColor: colors.blue.lighten4,
          cardColor: colors.shades.white,
        }
      },
    }
  }

nuxt generate ignores the custom colors and uses the default colors for each theme when generating static pages.

nuxt dev displays the correct custom colors on initial page load. On page navigation it reverts back to the colors for the default theme (depending on dark: true or not), but that I believe is a different issue (vuetifyjs/vuetify#7879).

This issue is for nuxt generate completely ignoring the defined colors for both light and dark themes, on both initial page load and subsequently.

Vuetify toolbar changes its size when reloading

Version

last

Reproduction link

https://www.npmjs.com/package/@nuxtjs/vuetify

Steps to reproduce

Basically create a project choosing vuetify as the framework. Then, run yarn run dev and wait for the server to start. When it has started reload the page several times, you will see that the toolbar changes its size, bumping.

What is expected ?

The toolbar should not change its size.

What is actually happening?

The toolbar changes its size.

This bug report is available on Nuxt community (#c141)

Nuxt removed dynamic imports from vuetify config

Hya, checked this both on 1.5.6 and now on the next branch.

Vuetify allowed you to use custom icons like so:

icons: { iconfont: 'md', values: { character: { component: () => import('~/assets/icons/charactersIcon.vue') } }

Inside of the theme configuration, now it seems that the after compilation nuxt (or someting else) removes the dynamic import and changes it to an empty object.

Img of nuxt.config:
image

Img of compiled vuetify.js file:
image

Now If I take that import and path it into the vuetify.js file it works as expected so issue here is that for some reason the compilation removes that line and changes it to an empty object instead.

How to get SASS working in next branch

I set up a new nuxt project. I added the next branch like it says here:
https://github.com/nuxt-community/vuetify-module#setup

It works.
Now I want to customize SASS Variables. I created a file here: plugins/vuetify.js and referenced it in nuxt.config.js like so modules: ['@/plugins/vuetify'],.

This is the content of my vuetify file:

import Vue from 'vue'
import Vuetify from 'vuetify/lib'

const opts = {
  options: {
    customProperties: true
  },
  customVariables: ['~/assets/style/variables.scss'],
  treeShake: true,
  icons: {
    iconfont: 'md'
  },
  theme: {
    themes: {
      light: {
        primary: '#334451',
        secondary: '#77b139',
        accent: '#77b139',
        error: colors.red.base,
        warning: colors.orange.base,
        info: '#ffffff',
        success: '#77b139',
        black: '#010101',
        white: '#ffffff'
      },
      dark: {
        primary: '#334451',
        secondary: '#77b139',
        accent: '#77b139',
        error: colors.red.base,
        warning: colors.orange.base,
        info: '#ffffff',
        success: '#77b139',
        black: '#010101',
        white: '#ffffff'
      }
    }
  }
}

Vue.use(Vuetify, opts)

When I run npm run dev I get this error and the script terminates:

> nuxt


 FATAL  Invalid or unexpected token                                       

  @import '../../styles/styles.sass'
  ^
  
  SyntaxError: Invalid or unexpected token
  at Object.compileFunction (vm.js:383:10)
  at Generator.next (<anonymous>)
  at Object.<anonymous> (node_modules/vuetify/lib/components/VApp/VApp.js:1)
  at Generator.next (<anonymous>)


   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                              โ”‚
   โ”‚   โœ– Nuxt Fatal Error                         โ”‚
   โ”‚                                              โ”‚
   โ”‚   SyntaxError: Invalid or unexpected token   โ”‚
   โ”‚                                              โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

how use breakpoint with vuetify module

my config:

  vuetify: {
    theme:{
      breakpoint: {
        thresholds: {
          xs: 340,
          sm: 540,
          md: 800,
          lg: 960,
          xl: 1280,
        }
      }
    },
	  treeShake: checkProduction()
  },

it not working , can you tell me the wrong place?

Use a file for vuetifyOptions over raw module options

After reading #27 (comment), an idea came to my mind :

Implementing a way to provide a path to a file that contains the vuetifyOptions

-> Make it watched by Nuxt and means being able to update icons, theme, etc... without having to wait for full Nuxt rebuild.

-> As it would be imported in https://github.com/nuxt-community/vuetify-module/blob/master/lib/plugin.js , it's a plugin which means you could even write the options in TypeScript without needing TypeScript runtime, just TypeScript build, which means less dependencies to install (unless you're already using TypeScript runtime for other pieces of your configuration file)

-> Globally it should fix any issue that was caused by serialization of the module options which means : theme.options.minifyTheme function, theme.options.themeCache using cache like LRU, theme.icons.values.xxx.component custom icon component.

Related :
#27
#71

devModules

int the READEME,
shouldn't it be 'modules'?
i can't find the devModule option in the NUXT document,only modules,
and i set in the modules it works

Translate option is not working

Hello.
In the nuxt.config.js i plug in the translation file.
const VUETIFY_RU_I18N = require('vuetify/src/locale/ru.ts')

And in the plugin module settings I do the following settings:

vuetify: {
  treeShake: true,
  lang: {
    locales: { VUETIFY_RU_I18N }, // or locale: { VUETIFY_RU_I18N }
    current: 'ru'
  }
},

I also tried such settings:

vuetify: {
  treeShake: true,
  lang: {
    locales: VUETIFY_RU_I18N, // or locale: VUETIFY_RU_I18N
    current: 'ru'
  }
}

It all doesn't work. What could be the problem? Thank!

Vuetify with nuxt not building but dev is working

Hi guys,

I am trying to upgrade to vuetify 2 but I keep running into some problems. It is that of the switch to dart-sass. I am was node-sass before but as shown in the vuetify upgrade guide they use dart-sass.

Everything worked when using it in demo. Probably because the vuetify module is in devModules. So I added this to my nuxt.config.js

build: {
    loaders: {
      scss: {
        implementation: require('sass'),
        fiber: require('fibers')
      }
    }
}

But this also didn't work. The error that I keep seeing:
Hyper_k1Fc2PE6gS

I tried it with node-sass and sass package with it also being in my loaders. The only option I am seeing right now is to change all my scss to sass which is far from ideal.

My nuxt config looks like this:

require('dotenv').config()

module.exports = {
  mode: 'universal',
  head: {
    title: 'roster',
    meta: [{ charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
  },
  loading: { color: '#4BAC6A' },
  css: ['~/assets/style/base.scss'],
  plugins: [
    '~/plugins/axios.js',
    '~/plugins/dayspan-vuetify.js',
    '~/plugins/filters.js',
    '~/plugins/global-components.js',
    '~/plugins/globals.js',
    '~/plugins/scheduleSettings.js',
    '~/plugins/jwt.js',
    '~/plugins/vee-validate.js',
    '~/plugins/vue-lazyload.js'
  ],
  devModules: ['@nuxtjs/vuetify'],
  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/axios',
    '@nuxtjs/pwa',
    '@nuxtjs/style-resources',
    'cookie-universal-nuxt',
    [
      'nuxt-i18n',
      {
        seo: false,
        locales: [
          {
            code: 'en',
            iso: 'en-US',
            name: 'English'
          },
          {
            code: 'nl',
            iso: 'nl-NL',
            name: 'Nederlands'
          }
        ],
        defaultLocale: 'en',
        vueI18n: {
          messages: {
            en: require('./assets/translations/en.json'),
            nl: require('./assets/translations/nl.json')
          }
        },
        strategy: 'prefix_except_default',
        silentTranslationWarn: false
      }
    ]
  ],
  styleResources: {
    scss: ['~/assets/style/variables.scss']
  },
  axios: {
    proxy: true
  },
  proxy: {
    '/api/': {
      target: process.env.API_SITE,
      pathRewrite: {
        '^/api': ''
      }
    }
  },
  vuetify: {
    customVariables: ['~/assets/style/variables.scss']
  },
  manifest: {
    theme_color: '#4BAC6A',
    background_color: '#4BAC6A',
    name: 'Effe',
    description: 'An original take on scheduling',
    display: 'standalone'
  },
  server: {
    port: process.env.PORT
  },
  env: process.env,
  build: {
    extend(config, ctx) {
      const urlLoader = config.module.rules.find(rule => rule.test.test('.ttf'))
      urlLoader.test = /\.(woff2?|eot|ttf|pdf|otf)(\?.*)?$/i

      // Run ESLint on save
      if (ctx.isDev && ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}

Version

  • nuxt: 2.8.1
  • @nuxtjs/vuetify: 1.0.2
  • node: 10.15

Thanks in advance!

1.0.0-alpha.6

I am experience some issues using "1.0.0-alpha.6". Any tips?

Error: [nuxt] Error while mounting app: TypeError: vuetify__WEBPACK_IMPORTED_MODULE_1___default.a is not a constructor

nuxt.config.js

require('dotenv').config()

export default {
  mode: 'spa',

  /*
   ** Nuxt.js modules
   */
  modules: ['@nuxtjs/axios', '@nuxtjs/dotenv'],

  devModules: ['@nuxtjs/vuetify'],

  vuetify: {},

  /*
   ** Axios module configuration
   */
  axios: {
    baseURL: process.env.API_URL
  },

  /*
   ** Build configuration
   */
  build: {
    extend(config, ctx) {
      // Run ESLint on save
      if (ctx.isDev && ctx.isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/,
          options: {
            fix: true
          }
        })
      }
    }
  }
}

package.json

"dependencies": {
    "@nuxtjs/axios": "^5.4.1",
    "@nuxtjs/dotenv": "^1.3.0",
    "@nuxtjs/vuetify": "^1.0.0-alpha.6",
    "cross-env": "^5.2.0",
    "nuxt": "^2.7.1"
},
  "devDependencies": {
    "@nuxtjs/eslint-config": "^0.0.1",
    "@vue/test-utils": "^1.0.0-beta.27",
    "axios-mock-adapter": "^1.16.0",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^24.1.0",
    "eslint": "^5.15.1",
    "eslint-config-prettier": "^4.1.0",
    "eslint-config-standard": ">=12.0.0",
    "eslint-loader": "^2.1.2",
    "eslint-plugin-import": ">=2.16.0",
    "eslint-plugin-jest": ">=22.3.0",
    "eslint-plugin-node": ">=8.0.1",
    "eslint-plugin-nuxt": ">=0.4.2",
    "eslint-plugin-prettier": "^3.0.1",
    "eslint-plugin-promise": ">=4.0.1",
    "eslint-plugin-standard": ">=4.0.0",
    "eslint-plugin-vue": "^5.2.2",
    "full-icu": "^1.3.0",
    "jest": "^24.1.0",
    "nodemon": "^1.18.9",
    "prettier": "^1.16.4",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "vue-jest": "^3.0.3"
  }

scrollBehavior to from savedPosition console.log not work

I'm used
npx create-nuxt-app

and I selected module is

vueetify,
axios, pwa
eslint
ssr

in nuxt.config.js

router: {
scrollBehavior: function (to, from, savedPosition) {
console.log(to)
console.log(from)
console.log(savedPosition)
return { x: 0, y: 0 }
}
},

not working console.log and others..
check scrollBehavior

Load correctly css when changing the `iconfont`

Properly load CSS for each font type:

// nuxt.config.js
{
  vuetify: {
    defaultAssets: {
      icons: {
        iconfont: 'md' // 'mdi' || 'md' || 'fa' || 'fa4'
      }
    }
  }
}

mdi => https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css
md => https://fonts.googleapis.com/css?family=Material+Icons
fa => https://use.fontawesome.com/releases/v5.0.13/css/all.css
fa4 => https://cdn.jsdelivr.net/npm/[email protected]/css/font-awesome.min.css

[vuetify next] Icon font not show

My problem
alt text

I use the default options to test

nuxt.config

  modules: [
    // Doc: https://axios.nuxtjs.org/usage
    '@nuxtjs/vuetify',
    '@nuxtjs/axios',
  ],

  vuetify: {
    treeShake: process.env.NODE_ENV === 'production' ? true : false
  },

[Bug Report] Vuetify custom icon component throws compile error

Versions

Nuxt: 2.8.1
@nuxtjs/vuetify: 1.0.0

Reproduction Link

https://codesandbox.io/s/vuetify-font-awesome-svg-custom-icon-components-bqnce?fontsize=14

Actual Behavior

Vuetify custom icon component throws compile error:

ERROR  Could not compile template /sandbox/node_modules/@nuxtjs/vuetify/lib/plugin.js: Serializing native function: Boolean

Following config contains component prop which I assume will not pass through serializeFunction in lib/plugin.js:11.

icons: {
  values: {
    heart: {
      component: FontAwesomeIcon,
      props: {
        icon: ["fas", "heart"]
      }
    }
  }
}

[question] support vuetify@next

Hello, Do you have any plan to support vuetify@next?
Just a question, since I been working with nuxt and vuetify 1.5, and want to migrate to vuetify 2.0 as early as better.

Problems with nuxt-start and vuetify-loader

Vuetify-loader requires webpack to be present. So if you have nuxt as dev dependency and nuxt-start as prod dependency, app will fail to start in prod requiring webpack to be present. This can be fixed by adding webpack as a prod dependency, but then why should vuetify-loader depend on webpack.

This is probably more of an issue with vuetify-loader than this module, but I thought it is good to mention it here too

Generated "vendors.app" Chunk Large

With Vuetify version 1.5 the generated vendor.app JS file size for our app is 232KiB. When upgrading to Vuetify 2.0 with this module, the build size is double, 464 KiB.

With a fresh Nuxt and @nuxtjs/vuetify-module install the build size is still 362KiB.

After doing a Lighthouse audit, it is showing that: "[id] attributes on the page are not unique... The value of an id attribute must be unique to prevent other instances from being overlooked by assistive technologies." and the Failing Elements are: (3) "style#vuetify-theme-stylesheet"

Here are some screenshots of the build log. Can anyone else reproduce this?

Vuetify 1.5 (full app)
full-app-1 5-version

Vuetify 2.0 (full app)
full-app-2 0-version

Vuetify 2.0 (fresh install)
clean-install

Error when going to production

When I'm in dev mode my page looks perfect (see image 1)

Image 1 : https://imgur.com/ssETPG9

but when running npm run build and npm start it looks totally different (see image 2)

Image 2: https://imgur.com/Xu8GzBd

As can be seen in the images in development mode if the content is centered and when going to production looks bad.

Any idea?

This happened when I updated yesterday to the new version.

vuetify a la carte does not load the style of components completely

hello, im trying to generate a static universal app with nuxt-ts + vuetify. The plugin works fine until I dont activate the treeShake mode with css disabled.
I do not receive any error but the style of the page is not completely loaded.

after i run the command yarn run generate

this is the result with css enabled (final bundle 2.2mb)

  modules: [
    '@nuxtjs/vuetify'
  ],
  vuetify: {
    materialIcons: true,
    css: true,
    treeShake: true
  }

Screenshot from 2019-03-14 23-44-19

this is the result with css disabled and treeshake enabled (final bundle 900kb)

  modules: [
    '@nuxtjs/vuetify'
  ],
  vuetify: {
    materialIcons: true,
    css: false,
    treeShake: true
  }

Screenshot from 2019-03-14 23-42-26

The style of the components appear to be partially loaded.

my package.json file is this

{
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "build": "nuxt-ts build",
    "lint": "tslint --project .",
    "dev": "nuxt-ts",
    "generate": "nuxt-ts generate",
    "post-update": "yarn upgrade --latest",
    "start": "nuxt-ts start"
  },
  "dependencies": {
    "@nuxt/config-edge": "^2.5.0-25874561.ff93d14b",
    "@nuxtjs/vuetify": "^0.5.5",
    "axios": "^0.18.0",
    "loader": "^2.1.1",
    "nuxt-ts": "latest",
    "tachyons": "^4.11.1",
    "vue-property-decorator": "^7.3.0",
    "vuex-class": "^0.3.1"
  },
  "devDependencies": {
    "style-loader": "^0.23.1",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.2",
    "tslint-config-standard": "^8.0.1",
    "vue-cli-plugin-vuetify": "^0.5.0",
    "vuetify-loader": "^1.2.1"
  }
}

Minimal configuration not applying roboto

Module version
1.1.0

Describe the bug
It seems that Roboto is not applying.

To Reproduce
https://codesandbox.io/s/codesandbox-nuxt-yt253
https://yt253.sse.codesandbox.io/

Steps to reproduce the behavior:

  1. Install nuxt
  2. Add dev dependency @nuxtjs/vuetify
  3. Customize the layout to integrate a vuetify component with text (card for example)
  4. Launch yarn dev or yarn start
  5. See the home page and check the text style (no roboto applied)
  6. Network loads google font

Expected behavior
Roboto must apply without

vuetify-theme-stylesheet deleted when head is updated

Module version
nuxt: 2.8.1
@nuxtjs/vuetify: 1.0.2
node: 10.15

Describe the bug
The style sheet with the name "vuetify-theme-stylesheet" disappears when updating the head via the head function in the vue component. This means that color="primary" for example does not work anymore

To Reproduce
https://github.com/jessielaf/vuetify-nuxt-issue

Steps to reproduce the behavior:

  1. Clone repo
  2. yarn install
  3. yarn dev
  4. Go to localhost:3000
  5. Button is colored green
  6. Click on home
  7. Button has standard color

Expected behavior
All stylesheets remain intact and primary="color" works

Screenshots
Colors are not shown because stylesheet is deleted:
chrome_mEGr2FXV0g

@nuxt/vuetify override default font

I found that i need to change Vuetifye's $body-font-family variable, but i can't do this with nuxt.config.js in 'vuetify: {}' section.
Is it possible or what the best way to do it, cause vuetify.css is loading before others?
Thanks!

This question is available on Nuxt.js community (#c104)

Use modules with typescript and eslint

Hello guys!
Example, if I installed and use nuxtjs/vuetify. Vuetify has own index.d.ts file

Then in project typescript modules eslint will emphasizes with "error not found" all vuetify params, such as this.$vuetify.colors etc

This because all nuxt modules generate from string templates

Question: Is it possible to use some module in this package with typescript and eslint|tslint?

This question is available on Nuxt community (#c143)

Missing peer dependency

When I install the 2 version of this package I get following warning:

npm WARN [email protected] requires a peer of css-loader@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of vuetify@^1.3.0 but none is installed. You must install peer dependencies yourself.

vue-loader is included in [email protected] and it requires css-loader@* as a peer dependency. Do I need to install it?
[email protected] is required by @nuxtjs/[email protected] as a dependency. Do I need to install it? Shouldn't [email protected] have been installed already because it's a direct dependency of @nuxtjs/[email protected]?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.