Closed jfillmore closed 10 months ago
I can't reproduce your issue. Things work normally on my end. See: https://jsfiddle.net/rt9L4pky/1/
Hmm... found a bug after calling vanX.replace(items, ...)
: https://jsfiddle.net/jzhux7m9/
Will get it fixed soon.
@all-contributors please add @jfillmore for bug
@Tao-VanJS
I've put up a pull request to add @jfillmore! :tada:
Thanks for the fast responses!
I investigated a bit more, and using VanJS 1.2.3 it seems fine with a minified build. Using the debug build, however, manifests the bug. The version of VanX used had no effect. More specifically, I'm using the nomodule
versions.
Some of the relevant backtrace:
at <triggering code>
at van-x.debug.js:49:15
at van.debug.js:167:29
at runAndCaptureDeps (van.debug.js:21:14)
at bind (van.debug.js:68:18)
at Object.add (van.debug.js:88:90)
at add2 (van.debug.js:185:24)
at addToContainer (van-x.debug.js:54:5)
at Object.list (van-x.debug.js:77:51)
I think the specific error you were getting with the van.debug.js
is fixed in 1.2.4
release. You can try to use the latest version of VanJS.
I will fix the issue shown in https://jsfiddle.net/jzhux7m9/ soon.
Confirmed that upgrading fixed the van.debug.js
issue. Thanks! Looking forward to the other fix.
It's been a lot of fun working with such a minimalistic but useful library.
FYI, the issue was fixed in VanX 0.1.3
. You can check out the sample app here: https://jsfiddle.net/ktugd4jq/1/
I have an API that returns a list of objects, each of which has an inner object. This use case seems best handled using vanX with a combination of
vanX.reactive
,vanX.replace
, andvanX.list
to render a list of UI elements.At the surface level, this appears to work fine if you don't access inner objects:
However, the moment you attempt to access
baz
, you get the error:For example:
As a work around I'm currently rewriting nested objects as JSON strings and then parsing them when it's time to make use of them.
Perhaps I've misunderstood something here, however? I don't actually need nested state management, but have struggled so far to get reactivity working using vanjs alone under this scenario.