小编Neh*_*nia的帖子

在ES6中,模块将导致多个网络调用,因为无法在单个文件中定义2个模块

在ES6中,每个模块都在其自己的文件中定义.

这是否意味着如果我们采用es6方式,我们将不得不为每个javascript模块进行多次网络调用?

无论如何连接模块文件本质上为es6中的应用程序创建一个缩小的javascript文件?

我们可以将es6代码转换为es5并将其连接起来.

但是,如果没有转换为es5,是否意味着使用模块,我们将无法将所有javascript文件连接并缩小为一个?

javascript ecmascript-6

5
推荐指数
1
解决办法
153
查看次数

如何使用Angular Material预构建主题中的主题颜色

我想在我的CSS中使用材质主题中的特定颜色.

例如

.my_tab_group {
  border: 1px solid $some_color_from_theme;
}
Run Code Online (Sandbox Code Playgroud)

Angular Material是否通过某个变量显示不同的颜色阴影,以便我可以在我自己的.scss文件中使用(例如,如上面使用$ some_color_from_theme)?

angular-material2 angular

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

具有 React 查询的 CRA React 项目的项目结构

我们正在使用 CRA 开始一个新的 React 项目。并且,计划使用 React Query。

需要有关项目文件夹结构的帮助。基于功能的文件夹结构与基于文件类型的结构相比有何优势?

另外,仅使用 axios/fetch 调用并直接在组件中创建 useQuery/useMutation 挂钩的服务/API 有什么优势?与为每个reactQuery 创建自定义 Hook 相比?

// API call in a service file and using that API call in the component
export const fetchPost = (key, postId) =>
  axios.get(`/api/posts/${postId}`).then((res) => res.data)

//Custom Hooks for each API call in a service 
export default function usePost(postId) {
  return useQuery(postId && ['post', postId], fetchPost)
}
Run Code Online (Sandbox Code Playgroud)

reactjs react-query

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

WSL 停止工作并出现错误:0x80070003

WSL2 停止工作。当我重新安装 Linux 发行版时,单击启动按钮时会抛出以下错误:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.

Press any key to continue...
Run Code Online (Sandbox Code Playgroud)

wsl --help命令工作正常,但是wsl -l命令和其他 wsl 命令会抛出以下错误

The system cannot find the path specified.
Run Code Online (Sandbox Code Playgroud)

windows-subsystem-for-linux wsl-2

2
推荐指数
1
解决办法
6129
查看次数

Javascript编码嵌套lambda表达式的样式

什么是样式以获得更好的可读性的最佳方法,嵌套的lambda表达式如:

movieLists.forEach(movie => movie.videos.forEach(
                     video => allVideoIdsInMovieLists.push(video.id)));
Run Code Online (Sandbox Code Playgroud)

任何样式指南或Lambda表达式的最佳实践.

javascript lambda

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