gpt4 book ai didi

c# - SpreadJS 在基于 Webpack 的 Angular 应用程序中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 14:56:01 27 4
gpt4 key购买 nike

我正在尝试将 spreadjs 库添加到我的 Angular 5 应用程序中。我正在按照此链接中给出的教程进行操作。 https://www.grapecity.com/en/blogs/spread-sheets-and-angular但是教程和我的应用程序之间存在一个区别。我的应用程序正在使用 webpack。

当我尝试运行应用程序时出现以下错误

Uncaught ReferenceError: GC is not defined at Object. (gc.spread.sheets.angular.11.0.4.js:106) at webpack_require (bootstrap 05add16ed08b4def07f8:657) at fn (bootstrap 05add16ed08b4def07f8:85) at Object. (app.module.browser.ts:21) at webpack_require (bootstrap 05add16ed08b4def07f8:657) at fn (bootstrap 05add16ed08b4def07f8:85) at Object. (index.js:4) at webpack_require (bootstrap 05add16ed08b4def07f8:657) at fn (bootstrap 05add16ed08b4def07f8:85) at Object.options.path (html5-entities.js:190) (anonymous) @ gc.spread.sheets.angular.11.0.4.js:106 webpack_require @ bootstrap 05add16ed08b4def07f8:657 fn @ bootstrap 05add16ed08b4def07f8:85 (anonymous) @ app.module.browser.ts:21 webpack_require @ bootstrap 05add16ed08b4def07f8:657 fn @ bootstrap 05add16ed08b4def07f8:85 (anonymous) @ index.js:4 webpack_require @ bootstrap 05add16ed08b4def07f8:657 fn @ bootstrap 05add16ed08b4def07f8:85 options.path @ html5-entities.js:190 webpack_require @ bootstrap 05add16ed08b4def07f8:657 fn @ bootstrap 05add16ed08b4def07f8:85 decorate @ main-client.js?v=m6MAq5LYDxHuj3aQ3FLsDASzSdE0PXrpCFP8K7zsieI:4472 __webpack_require @ bootstrap 05add16ed08b4def07f8:657 module.exports @ bootstrap 05add16ed08b4def07f8:706 (anonymous) @ bootstrap 05add16ed08b4def07f8:706

我尝试将 javascript 链接添加到 webpack.config.vendor.js。我的后端是 .net 核心 webapi。请告诉我下一步该怎么做

最佳答案

编辑

这可能是未在 angular.json 文件中导入一些必需脚本的结果。这是当前 Angular 应用程序缺少的默认 SpreadJS 指令 GrapeCity 网站 ( https://www.grapecity.com/en/blogs/spread-sheets-and-angular ) 的一个步骤。

我在 GrapeCity 的 Angular/SpreadJS 博客 ( https://www.grapecity.com/en/blogs/create-angular-spreadsheets-with-angular-cli ) 上发现了这个缺失的步骤,这在他们的网站上有点隐藏。

您需要的步骤是:


angular.json:

{
(…)
"apps": [
{
(…)
"styles": [
"./lib/gc.spread.sheets.excel2013darkGray.11.0.0.css"
],
"scripts": [
"./lib/gc.spread.sheets.all.11.0.0.min.js"
],
(…)
}
],
(…)
}

将文件路径更改为放置 SpreadJS 文件的位置。请注意,至少在我的应用程序中,我的 angular.json 文件有两个 styles 数组和两个 scripts 数组 - 将这些引用插入到顶部集合(最接近 angular.json 文件顶部的样式和脚本数组)。

关于c# - SpreadJS 在基于 Webpack 的 Angular 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49063574/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com