小编s-l*_*ndz的帖子

使用电子生成器设置电子图标

我想在我的 Electron 应用程序中设置新的 favicon 并在我的应用程序构建时替换默认的 Electron 图标。

我用electron-builder包。在文档中,我看到图标need to be placed in the build directory.So :

在此处输入图片说明

当我构建我的应用程序时,我收到了这条消息:

Application icon is not set, default Electron icon will be used.

任何人都可以帮助我吗?

我的一部分package.json

  "scripts": {
    "postinstall": "install-app-deps && npmpd",
    "pre-build": "./node_modules/.bin/electron-rebuild",
    "build-bcrypt": "npm rebuild bcrypt --update-binary",
    "develop": "npm run private:compile -- --source-maps true && run-p -r private:watch private:serve",
    "test": "mocha -R spec --compilers js:babel-core/register test/**/*.spec.js",
    "lint": "eslint --no-ignore scripts app test *.js",
    "pack": "run-s private:clean private:compile …
Run Code Online (Sandbox Code Playgroud)

node.js electron electron-builder

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

Mobx-state-tree SSR 双初始化客户端和服务器

我在 NextJS 应用程序上使用 mobx-state-tree 进行服务器端渲染。仅在服务器上,我获取 API 来加载一些信息并添加到我的商店。但是在客户端加载之后,我的存储被清除,因为我需要在服务器和客户端上实例化。这是我的问题。

我的商店:

const Store = types
  .model('Store', {
    user: types.compose(User),
  });

const createStore = Store.create({
  user: {},
});

let store = null;

/**
 * Init store
 *
 * @param {bool} isServer
 * @param {object} snapshot
 */
const initStore = (isServer, snapshot = null) => {

  if (isServer) {
    store = createStore;
  }

  if (store === null) {
    store = createStore;
  }

  if (snapshot) {
    applySnapshot(store, snapshot);
  }

  return store;
};
Run Code Online (Sandbox Code Playgroud)

我在客户端的组件:

  static getInitialProps({ req …
Run Code Online (Sandbox Code Playgroud)

node.js reactjs mobx next.js mobx-state-tree

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

React-Native DisconnectableInputStream java异常

在新的React-Native项目中,我想在Android设备上运行默认应用程序,但我有这个Java例外:

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.4.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin …
Run Code Online (Sandbox Code Playgroud)

java android react-native

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

Promise.all返回函数

我想将Async / Await与访存API结合使用。因此,我有2个异步函数return result.json()

我在中添加了2 Promise Promise.all([]),但返回的值是'function()'。

我的代码:

  // Load external users
  const externalUsers = async () => {
    const result = await fetch(url);
    return result.json();
  };

  const localUsers = async () => {
    const result = await Users.allDocs({ include_docs: true });
    return result.rows;
  };

  Promise.all([externalUsers, localUsers]).then(values => {
    console.log(values); // return (2) [function, function]
  });
Run Code Online (Sandbox Code Playgroud)

我不明白为什么。你能帮助我吗 ?

谢谢社区!

javascript fetch promise async-await

4
推荐指数
2
解决办法
2298
查看次数

升级到0.60后,React-Native无法找到符号

我尝试将我的本机应用程序0.59.4升级到0.60.0。

我使用此链接作为升级所有本机文件的参考。但是,当我尝试在Android设备上运行我的应用程序时,出现了以下错误:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
12 actionable tasks: 4 executed, 8 up-to-date
/home/stephane/Project/youtube-audio-player/android/app/src/main/java/com/youtubeaudioplayer/MainApplication.java:5: error: cannot find symbol
import com.facebook.react.PackageList;
                         ^
  symbol:   class PackageList
  location: package com.facebook.react
/home/stephane/Project/youtube-audio-player/android/app/src/main/java/com/youtubeaudioplayer/MainApplication.java:6: error: cannot find symbol
import com.facebook.react.ReactApplication;
                         ^
  symbol:   class ReactApplication
  location: package com.facebook.react
/home/stephane/Project/youtube-audio-player/android/app/src/main/java/com/youtubeaudioplayer/MainApplication.java:7: error: cannot find symbol
import com.facebook.react.ReactNativeHost;
Run Code Online (Sandbox Code Playgroud)

有没有人已经成功升级到0.60版本?

android reactjs react-native

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

在 Linux 上安装特定的 adb 版本

我想使用特定的 adb 版本来连接设备。对于连接外部模拟器,我尝试使用adb connect localhost:5555,结果如下:

[adb]: adb server version (36) doesn't match this client (40); killing...
[adb]: * daemon started successfully
Run Code Online (Sandbox Code Playgroud)

对于安装 adb,我使用apt install adb但我只有 1.0.36 版。

有人知道我是否可以安装和使用 1.0.40 版的 adb 吗?

android adb

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

获取 Strapi 系列的所有项目

我在我的项目中使用 Strapi API,我想以 CSV 文件格式导出我的数据。

为此,我使用了一个find()请求,但 API 仅返回前 100 个项目,而我的数据库中有大约 2000 个项目。

是否可以删除limit我的 Strapi 请求中的 ?

node.js strapi

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

如何在react-native项目中启动watchman

我已经创建了我的第一个反应本机应用程序并react-native init myProject在我的 Android 模拟器中运行。

但是,如果我编辑我的index.js,我的应用程序不会刷新(我需要按双R)。

我使用 运行我的应用程序并react-native run-android使用npm start.

我的 Ubuntu 上安装了 watchman,watchman -v返回:

4.9.0

任何人都可以帮助我吗?

谢谢社区!

android reactjs watchman react-native

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

在数组ID中查找对象

我列出了数组中的id和其他数组中的文章列表.

我想在id的数组中article通过idsfind 过滤我的数组.

例如:

const ids = [ '1', '2', '3' ];
const articles = [
  { id: '1', title: 'blua' },
  { id: '10', title: 'blua' }
  ...
];
Run Code Online (Sandbox Code Playgroud)

我试过这个:

ids.map((id) => {
  return audits.find((audit) => {
    return id === audit.id;
  });
});
Run Code Online (Sandbox Code Playgroud)

但返回underfined:/

我认为这不是一个好的方法^^

有人可以帮帮我吗?

谢谢 !

javascript

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