我是新手,我正尝试在应用程序中使用数据表,但是由于某种原因,我遇到了一个错误:ERROR TypeError:$(...)。DataTable不是一个函数... 在过去的3个小时里,我一直在互联网上搜索所有发布的答案,例如:在组件中从“ jquery”中添加import * as jquery,但仍无法正常工作,非常感谢您的帮助
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DoPayroll</title>
<base href="/">
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-
awesome.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-
KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
</head>
<body>
<app-root></app-root>
</body>
</html>
angular.json
"styles": [
"src/styles.css","node_modules/angular-bootstrap-md/assets/scss/bootstrap/bootstrap.scss","node_modules/angular-bootstrap-md/assets/scss/mdb.scss","node_modules/ngx-toastr/toastr.css","node_modules/bootstrap/dist/css/bootstrap.min.css","node_modules/datatables.net-dt/css/jquery.dataTables.css"
],"scripts": [
"node_modules/jquery/dist/jquery.js","node_modules/datatables.net/js/jquery.dataTables.js"
]