Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript I';我在导入脉轮UI时遇到了这个错误_Javascript_Html_Css_Chakra - Fatal编程技术网

Javascript I';我在导入脉轮UI时遇到了这个错误

Javascript I';我在导入脉轮UI时遇到了这个错误,javascript,html,css,chakra,Javascript,Html,Css,Chakra,我在导入Chakra UI时遇到了这个错误 if (variantColorIsDefined) { var variantColorExists = variantColor in theme.colors; // If variant color exists in theme object ^ 114 | if (!variantColorExists) { console.warn("You passed an i

我在导入Chakra UI时遇到了这个错误

   
   if (variantColorIsDefined) {
      var variantColorExists = variantColor in theme.colors; // If variant color exists in theme object
       ^  114 | 
    if (!variantColorExists) {
      console.warn("You passed an invalid variantColor to the " + label + " Component. Variant color values must be a color key in the theme object that has '100' - '900' color values. Check http://chakra-ui.com/theme#colors to see possible values");

这在文档中有点难以理解,一种变体颜色实际上是一组颜色

在主题中,您需要定义颜色和相应的:悬停值,例如,so:

yellow: {
  500: "#FFFF80",  //this is the default color
  600: "#FFFF00"   //this is the color on hover
},
然后在组件中引用它,如下所示:

<IconButton size="sm" icon="unicorn" isRound variantColor="yellow" />