小编Ale*_*yko的帖子

mat-date-range-input isn't known element [Angular material]

The problem is that I can't use <mat-date-range-input> Material Component because I get an error:

在此处输入图片说明

I have a module called "Material module" and there's an import and export of MatNativeDateModule and MatDatepickerModule. This module is imported into module I'm working with.

I can use simple mat-datepicker and it works properly.

Can anybody help me with that?

10.1.2 - version of Material

datepicker typescript angular-material angular

7
推荐指数
1
解决办法
1万
查看次数

Angular Material Snackbar 位置

我想将材料小吃店放在我的标题下(它的高度为 60 像素)。

问题是verticalPosition 将snackbar 放在顶部并覆盖标题。我试图添加“margin-top: 75px”,但上面的区域无法点击。(有叠加)

在此处输入图片说明

我无法更改 cdk-overlay-pan 的样式,因为我还有其他对话框。

css angular-material snackbar angular

6
推荐指数
1
解决办法
3790
查看次数

当我使用扩展语法和解构时,Lint 显示错误

我有传播和解构运算符的问题。在 npm run lint:js 之后我会看到:

TypeError: Cannot read property 'type' of undefined
Occurred while linting C:\Users\USER\hq-manager-frontend\frontend\src\common\functions\projects.js:8
    at checkDestructured (C:\Users\USER\hq-manager-frontend\frontend\node_modules\eslint\lib\rules\no-useless-rename.js:104:43)
    at C:\Users\USER\hq-manager-frontend\frontend\node_modules\eslint\lib\linter\safe-emitter.js:45:58
Run Code Online (Sandbox Code Playgroud)

用于 ReactJs

project.employees.map(({ billedHours, employee }) => {
      const result = billedHours.reduce((res, current) => {
        const { date, ...others } = current;
        return {
          ...res,
          [date]: {
            hours: others,
            activeDates: [],
          },
        };
      }, {});

Run Code Online (Sandbox Code Playgroud)

.eslintrc.json

{
  "extends": ["airbnb", "prettier", "prettier/react"],
  "plugins": ["prettier"],
  "rules": {
    "react/jsx-filename-extension": [
      1,
      {
        "extensions": [".js", ".jsx"]
      }
    ],
    "react/jsx-props-no-spreading": 0,
    "react/no-unused-state": 1,
    "react/prop-types": …
Run Code Online (Sandbox Code Playgroud)

javascript lint destructuring spread

5
推荐指数
0
解决办法
452
查看次数