vaso2 / nuxt-vue-material Goto Github PK
View Code? Open in Web Editor NEWModule to join nuxt and vue-material
License: MIT License
Module to join nuxt and vue-material
License: MIT License
I get this when trying to use your lib.
ERROR Nuxt error
TypeError: Cannot read property 'length' of undefined
- module.js:352 Function.Module._resolveLookupPaths
module.js:352:15
- module.js:541 Function.Module._resolveFilename
module.js:541:20
- nuxt.js:198 Nuxt.resolvePath
[nuxt]/[nuxt]/lib/core/nuxt.js:198:35
- module.js:121 ModuleContainer.addModule
[nuxt]/[nuxt]/lib/core/module.js:121:35
- utils.js:96 promise.then
[nuxt]/[nuxt]/lib/common/utils.js:96:43
- next_tick.js:188 process._tickCallback
internal/process/next_tick.js:188:7
- module.js:695 Function.Module.runMain
module.js:695:11
- bootstrap_node.js:188 startup
bootstrap_node.js:188:16
- bootstrap_node.js:609
bootstrap_node.js:609:3
Ran:
npm install vue-material --save
npm i nuxt-vue-material --save
npm run dev
Added:
modules: [
['nuxt-vue-material', {
theme: 'default-dark'
}],
]
i ve try to import only MdSelect component and avoiding get the whole library, like de docs said. and when I put this in the modules array of nuxt.config file:
['nuxt-vue-material', {
theme: 'default-dark',
components: ['MdSelect',]
}],
and this in my template:
<md-field>
<label for="movies">Movies</label>
<md-select v-model="selectedMovies" name="movies" id="movies" multiple>
<md-option value="fight-club">Fight Club</md-option>
<md-option value="godfather">Godfather</md-option>
<md-option value="godfather-ii">Godfather II</md-option>
<md-option value="godfather-iii">Godfather III</md-option>
<md-option value="godfellas">Godfellas</md-option>
<md-option value="pulp-fiction">Pulp Fiction</md-option>
<md-option value="scarface">Scarface</md-option>
</md-select>
</md-field>
when the app finally compiles, i get this error in my browser
Cannot read property 'install' of undefined
The errors gone obviously when i pass the components array options empty, but this affects my performance
Also ive try rendering other compoenents like buttons, lists, and its all ok. only the select component gives me errors
thanks in advance
As the title says. Tested in a fresh installation of NUXT.
nuxt.config.js
['nuxt-vue-material', {
css: false,
theme: 'default',
components: [ 'MdRadio', 'MdMenu', 'MdContent', 'MdList', 'MdButton', 'MdToolbar',]
}],
creates...
.nuxt/vue-material.js
import Vue from 'vue'
import 'vue-material/dist/vue-material.min.css'
import { MdRadio,MdMenu,MdContent,MdList,MdButton,MdToolbar } from 'vue-material/dist/components'
Vue.use(MdRadio)
Vue.use(MdMenu)
Vue.use(MdContent)
Vue.use(MdList)
Vue.use(MdButton)
Vue.use(MdToolbar)
... but I need to get rid of import 'vue-material/dist/vue-material.min.css'
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.