balmjs / balm-ui

:diamonds: A modular and customizable UI library based on Material Design and Vue
https://material.balmjs.com
MIT License
506 stars 30 forks source link

$theme.colors is not a function #107

Closed Ivan1105 closed 2 years ago

Ivan1105 commented 2 years ago

Development Relevant Information:

Description:

I wanted to change the theme colors and used this.$theme.colors(color) as it was declared

interface BalmUITheme {
  colors(color: ThemeColor): void;
}

But the browser reports Uncaught TypeError: this.$theme.colors is not a function

It works well if I write as (this.$theme.colors as ThemeColor) = color.

elf-mouse commented 2 years ago

Hi @Ivan1105 , It's a getter, not a function.

This is a mistake in the theme documentation. I have updated.

Thank you very much :)

NOW, balm-ui@9 is the new default version.