Angular模块没有导出的成员' ButtonFillMode'

发布于 2025-01-18 17:49:38 字数 623 浏览 2 评论 0原文

在使用 kendo Editor 工具栏模块时,我收到错误消息 '"@progress/kendo-angular-buttons"' 没有导出的成员 'ButtonFillMode'。。我已经安装了 EditorModule 库的所有依赖项。即使我也遇到同样的错误。我指的使用角度编辑器工具栏的链接是 https: //www.telerik.com/kendo-angular-ui/components/editor/tools/

下面是我在构建 Angular 项目时遇到的错误。

输入图片此处描述

我正在使用 Angular 12 和 Kendo UI。我还尝试使用 kendo Editor Toolbar 库。

如果您遇到过此类错误以及是否已解决,请告诉我。 先感谢您。

I am getting error saying '"@progress/kendo-angular-buttons"' has no exported member 'ButtonFillMode'. while using kendo Editor toolbar module. I have install all the dependencies for EditorModule libraries. Even I am getting the same error. the link which I am referring to use editor toolbar in angular is https://www.telerik.com/kendo-angular-ui/components/editor/tools/

Belows are the error which I am getting while building my Angular project.

enter image description here

I am using Angular 12 with Kendo UI. Also I'm trying use kendo Editor Toolbar libraries.

please let me know if you have faced this kinds of error and if you have resolved it.
Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

那请放手 2025-01-25 17:49:38

我不认为 Kendo 的库中明确定义了这些选项。如果您查看底层 JavaScript(特别是 kendo-angular-buttons/dist/cdn/main.js),getStylingClasses 方法会执行以下操作:

t.getStylingClasses = function(e, n, i, o) {
  switch (n) {
    case "size":
      return {
        toRemove: "k-" + e + "-" + t.SIZES[i], toAdd: o ? "k-" + e + "-" + t.SIZES[o] : null
      };
    case "rounded":
      return {
        toRemove: "k-rounded-" + a[i], toAdd: o ? "k-rounded-" + a[o] : null
      };
    case "fillMode":
    case "shape":
      return {
        toRemove: "k-" + e + "-" + i, toAdd: o ? "k-" + e + "-" + o : null
      }
  }
}

理论上,您可以设置 fillMode 对于一个坏值(如 ​​foo),它所做的就是添加以下类:

.k-button-foo-base, .k-button-foo

我认为最好的选择是将值简单地定义为可导出的枚举:

export enum ButtonFillMode {
  Solid = 'solid',
  Flat = 'flat',
  Outline = 'outline',
  Clear = 'clear',
  Link = 'link',
}

I don't think that the options are explicitly defined in Kendo's library. If you look at the underlying JavaScript (specifically kendo-angular-buttons/dist/cdn/main.js), the getStylingClasses method does the following:

t.getStylingClasses = function(e, n, i, o) {
  switch (n) {
    case "size":
      return {
        toRemove: "k-" + e + "-" + t.SIZES[i], toAdd: o ? "k-" + e + "-" + t.SIZES[o] : null
      };
    case "rounded":
      return {
        toRemove: "k-rounded-" + a[i], toAdd: o ? "k-rounded-" + a[o] : null
      };
    case "fillMode":
    case "shape":
      return {
        toRemove: "k-" + e + "-" + i, toAdd: o ? "k-" + e + "-" + o : null
      }
  }
}

Theoretically you can set the fillMode to a bad value (like foo), all it does is add the following classes:

.k-button-foo-base, .k-button-foo

I think your best option would be to simply define the values as an exportable enum:

export enum ButtonFillMode {
  Solid = 'solid',
  Flat = 'flat',
  Outline = 'outline',
  Clear = 'clear',
  Link = 'link',
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文