小编dpl*_*aza的帖子

在 Electron JS 应用程序上使用 npm 中的 Realm

我尝试使用通过 NPM 导入的 Realm 但失败了。

我正在使用 JavaScript 的 Realm 示例:

const Realm = require('realm');

// Define your models and their properties
const CarSchema = {
  name: 'Car',
  properties: {
    make:  'string',
    model: 'string',
    miles: {type: 'int', default: 0},
  }
};
const PersonSchema = {
  name: 'Person',
  properties: {
    name:     'string',
    birthday: 'date',
    cars:     'Car[]',
    picture:  'data?' // optional property
  }
};

Realm.open({schema: [CarSchema, PersonSchema]})
  .then(realm => {
    // Create Realm objects and write to local storage
    realm.write(() => {
      const …
Run Code Online (Sandbox Code Playgroud)

realm electron npm-install

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

标签 统计

electron ×1

npm-install ×1

realm ×1