gpt4 book ai didi

angular - primeNG 升级到 8.0.1 加载数据表时出错

转载 作者:行者123 更新时间:2023-12-02 17:11:02 26 4
gpt4 key购买 nike

我需要将我的 primeng 软件包从 7 升级到 8。

我收到以下错误:

anager-console/src/main/frontend/node_modules/primeng/primeng"' 没有导出成员“DataTable”

在组件文件中找不到以下导入

import { DataTable } from 'primeng/primeng';

package.json

"private": true,
"dependencies": {
"@angular/animations": "7.2.15",
"@angular/cdk": "7.3.7",
"@angular/common": "7.2.15",
"@angular/compiler": "7.2.15",
"@angular/core": "7.2.15",
"@angular/forms": "7.2.15",
"@angular/http": "7.2.15",
"@angular/platform-browser": "7.2.15",
"@angular/platform-browser-dynamic": "7.2.15",
"@angular/router": "7.2.15",
"@fortawesome/fontawesome-free": "^5.7.2",
"bootstrap": "^3.4.1",
"classlist.js": "^1.1.20150312",
"core-js": "^2.6.5",
"floatthead": "^2.1.3",
"jquery": "^3.4.1",
"jquery-ui-dist": "^1.12.1",
"ng-treetable": "^1.3.3",
"ngx-bootstrap": "^3.2.0",
"primeicons": "^1.0.0",
"primeng": "^8.0.1",
"rxjs": "^6.4.0",
"rxjs-compat": "^6.4.0",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.29"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.9",
"@angular/cli": "7.3.9",
"@angular/compiler-cli": "7.2.15",
"@angular/language-service": "7.2.15",
"@types/jasmine": "^2.8.16",
"@types/jasminewd2": "^2.0.6",
"@types/node": "^10.14.1",
"codelyzer": "^5.0.1",
"eslint": "^5.16.0",
"jasmine-core": "~3.3.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.3",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "^5.4.1",
"ts-node": "~7.0.1",
"tslint": "~5.16.0",
"typescript": "3.1.6"
}

更新

我确实将 Angular 更新到了 8,但仍然遇到同样的问题。

经过进一步调查,DataTable 组件在 primeNG 8 中被删除。我查看了发行说明,没有提到删除 DataTable 组件。现在我需要找出我该用什么来代替..

link to primeNg issue

最佳答案

替换了所有import { DataTable } from 'primeng/primeng';with import { Table } from 'primeng/table';解决了我的问题

关于angular - primeNG 升级到 8.0.1 加载数据表时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57059259/

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