slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.94k stars 568 forks source link

In the novice tutorial, JS access to the slint array is not available. #4991

Closed sbfkcel closed 5 months ago

sbfkcel commented 5 months ago

package.json

{
  "name": "slint",
  "version": "1.0.0",
  "main": "index.js",
  "type": "module",
  "license": "MIT",
  "dependencies": {
    "slint-ui": "^1.5.1"
  }
}

https://releases.slint.dev/1.5.1/docs/tutorial/node/creating_the_tiles_from_js

The sixth line of code

let initial_tiles = mainWindow.memory_tiles;

should be modified to

let initial_tiles = [...mainWindow.memory_tiles];
tronical commented 5 months ago

Thanks for the report - fixed in #4986 :)