从 Angular 版本 8 升级到 10 后。
运行 - ng serve 命令给我错误 -
node_modules/ngx-tree-select/src/module.d.ts:11:56 中的错误 - 错误 TS2314:通用类型“ModuleWithProviders”需要 1 个类型参数。
11 static forRoot(options: TreeSelectDefaultOptions): ModuleWithProviders; ~~~~~~~~~~~~~~~~~~~
这是我的文件 - front/webapp/node_modules/ngx-tree-select/src/module.d.ts
import { ModuleWithProviders } from '@angular/core';
import { TreeSelectDefaultOptions } from './models/tree-select-default-options';
import * as ?ngcc0 from '@angular/core';
import * as ?ngcc1 from './components/tree-select.component';
import * as ?ngcc2 from './components/tree-select-item.component';
import * as ?ngcc3 from './directives/off-click.directive';
import * as ?ngcc4 from './pipes/item.pipe';
import * as ?ngcc5 from '@angular/common';
import * as …Run Code Online (Sandbox Code Playgroud) 我想在单击按钮时实现一个简单的顶部和底部滚动。在所有浏览器中滚动应该是平滑的。
要求 -
我在页面上有两个按钮,在页面顶部有一个名为Down的按钮,点击它应该向下到页脚 div。
页面底部还有一个名为UP 的按钮,点击它应该从屏幕向上。
我尝试了一种解决方案,但在 IE 中,滚动不流畅。我们如何才能使所有浏览器的滚动行为流畅。
目前我在 CSS 中使用了 scroll-behavior 属性,但这是一个好习惯吗?有没有办法用 JavaScript 而不是 CSS 来做到这一点?
html{
scroll-behavior: smooth;
}
Run Code Online (Sandbox Code Playgroud)
注意:它也应该在 IE 中工作。
我将衷心感谢您的帮助。
代码的 codepen 链接 - https://codepen.io/Akkanksha1/full/KKgWmgL