小编Ada*_*dam的帖子

如何在 Remix 中创建自定义样式的 404 页面

您好,我如何在 Remix 中设计和创建自定义 404 页面。

我想在识别路径时用我自己的内容覆盖当前的 404 页面。

在此输入图像描述

remix.run

7
推荐指数
2
解决办法
3872
查看次数

4
推荐指数
1
解决办法
7491
查看次数

Angular 6将HTML中的背景色设置为CSS变量

我正在使用Angular 6,我有一个简单的方法div,想div从模板内部设置它的背景色。通过正常颜色时,此方法效果很好。但这不适用于CSS变量。

这个例子有效

<div [style.background]="'red'">...</div>
Run Code Online (Sandbox Code Playgroud)

这个例子不起作用

<div [style.background]="'var(--some-css-var)'">...</div>
Run Code Online (Sandbox Code Playgroud)

html css angular

3
推荐指数
3
解决办法
5944
查看次数

TypeScript const 断言和声明有什么区别?

我刚刚读到了 TypeScript 3.4 RC 中的新const断言功能,但我没有看到它与使用声明有何不同const

我使用公告页面中的一个示例对此进行了测试,该示例显然演示了如何使用as constconst断言)防止文字类型被扩展(例如,"circle"to string)。

// Example from official announcement
function getShapes() {
  let result = [
    { kind: "circle", radius: 100 },
    { kind: "square", sideLength: 50 },
  ] as const;

  return result;
}

for (const shape of getShapes()) {
  if (shape.kind === "circle") {
    console.log("Circle radius", shape.radius);
  } else {
    console.log("Square side length", shape.sideLength);
  }
}

// Output:
// Circle radius 100
// …
Run Code Online (Sandbox Code Playgroud)

typescript typescript3.0

3
推荐指数
1
解决办法
3182
查看次数

标签 统计

angular ×1

css ×1

html ×1

javascript ×1

json ×1

postman ×1

remix.run ×1

typescript ×1

typescript3.0 ×1