vue-material icon indicating copy to clipboard operation
vue-material copied to clipboard

import md plugins as components

Open waozi-dev opened this issue 6 years ago • 19 comments

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

waozi-dev avatar Nov 18 '17 01:11 waozi-dev

I think this is possible in new version no?

Samuell1 avatar Nov 18 '17 09:11 Samuell1

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

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

waozi-dev avatar Nov 18 '17 14:11 waozi-dev

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.

marcosmoura avatar Nov 18 '17 23:11 marcosmoura

Any news on this? @marcosmoura

jkosonen avatar Feb 28 '18 07:02 jkosonen

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?

riccardogiorato avatar Jun 04 '18 13:06 riccardogiorato

@Giorat this will be supported in next release

Samuell1 avatar Jun 04 '18 17:06 Samuell1

Is this fixed yet ? :)

naimlatifi5 avatar Jun 16 '18 20:06 naimlatifi5

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.

JamesCoyle avatar Sep 18 '18 20:09 JamesCoyle

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

ortonomy avatar Dec 26 '18 17:12 ortonomy

A year later, nothing ?

Epistol avatar Sep 09 '19 18:09 Epistol

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

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

margi212 avatar Jan 03 '20 07:01 margi212

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

tekook avatar Mar 06 '20 11:03 tekook

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

Is Related?

nathanael540 avatar May 29 '20 15:05 nathanael540

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

  • vue: 2.6.11
  • typescript: 3.9.7
  • vue-class-component. 7.2.3
  • vue-material: 1.0.0-beta-15

Any new updates?

mora200217 avatar Aug 18 '20 01:08 mora200217

Any updates on this?

goddas avatar Sep 25 '20 15:09 goddas

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

MuhaddiMu avatar Oct 20 '20 11:10 MuhaddiMu

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

ortonomy avatar Oct 20 '20 11:10 ortonomy

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?

tekook avatar Oct 21 '20 04:10 tekook

@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

ortonomy avatar Oct 21 '20 04:10 ortonomy