vuematerial / vue-material

Vue.js Framework - ready-to-use Vue components with Material Design, free forever.
https://www.creative-tim.com/vuematerial
MIT License
9.88k stars 1.16k forks source link

import md plugins as components #1166

Closed waozixyz closed 2 weeks ago

waozixyz commented 6 years ago

I think it would be great if it were possible to add the plugins as components

So instead of having a centralized file with all md plugins

import { MdButton, MdContent, MdTabs } from 'vue-material/dist/components'

Vue.use(MdButton)
Vue.use(MdContent)
Vue.use(MdTabs)

you could just add what one needs for each component

import { MdButton, MdContent, MdTabs } from 'vue-material/dist/components'
export default {
  components: {
    MdButton,
    MdContent,
    MdTabs 
  }
}

its the same way the quasar framework manages components and i think it is a nice approach since you have more control what plugins to use for each component instead of adding them globally

Samuell1 commented 6 years ago

I think this is possible in new version no?

waozixyz commented 6 years ago

@Samuell1 when i try to do it i get this error:

[Vue warn]: Error in render: "TypeError: e.component is not a function"
marcosmoura commented 6 years ago

You can do this right now importing the component from the source, but you will have to import the dependencies manually. I will change that soon.

jkosonen commented 6 years ago

Any news on this? @marcosmoura

riccardogiorato commented 6 years ago

import md as components should decrease the bundle size of the app am I right @marcosmoura ? Can you help us or the rest of the team support this?

How can we help?

Samuell1 commented 6 years ago

@Giorat this will be supported in next release

naimlatifi5 commented 6 years ago

Is this fixed yet ? :)

JamesCoyle commented 5 years ago

Any update on this? I thought this was how it worked until I searched for this issue as thats how Vue components are supposed to be implemented.

ortonomy commented 5 years ago

Same as above, I'm trying to do this and getting

[Vue warn]: Error in render: "TypeError: e.component is not a function"

Vue version: 2.5.17

Epistol commented 5 years ago

A year later, nothing ?

margi212 commented 4 years ago

Any update? @marcosmoura Facing below error with Vue Version 4.1.2

[Vue warn]: Error in render: "TypeError: e.component is not a function"

tekook commented 4 years ago

Why is this so difficult? This should be standard to import the components via imports in vue-components.

nathanael540 commented 4 years ago

Error in render: "TypeError: e.use is not a function"

Is Related?

mora200217 commented 4 years ago

Same problem. Trying to import component with "vue-class-component"

import Component from "vue-class-component";
import { MdIcon, MdButton } from 'vue-material/dist/components'; 

@Component({
  components: {
    MdIcon, 
   MdButton
}
})

Console throwing:

[Vue warn]: Error in render: "TypeError: e.component is not a function. (In 'e.component(s.default.name,s.default)', 'e.component' is undefined)"

Environment / Setup

Any new updates?

goddas commented 3 years ago

Any updates on this?

MuhaddiMu commented 3 years ago

It's been three years and there's no update on this issue. It's time to move on to Vuetify :(

ortonomy commented 3 years ago

Or just don't use Material design. It's only a few later and I already can't stand most interfaces that use it.

tekook commented 3 years ago

It's been three years and there's no update on this issue. It's time to move on to Vuetify :(

Moved on to vuetify long ago. The library is much easier to use and they listen to requests 👍

Or just don't use Material design. It's only a few later and I already can't stand most interfaces that use it.

Do you have some alternatives which offer the same amount of features?

ortonomy commented 3 years ago

@tekook

Do you have some alternatives which offer the same amount of features?

https://athemes.com/collections/vue-ui-component-libraries/

Element, Ant, Bulma, Chakra, Semantic if you must use a pre-built..

it's still just as easy to build your own... Tailwind CSS, etc.. other opinions are available of course