Closed malash closed 2 years ago
For data in template <template is="temp" data="{{{ ...obj }}}" />, when value in obj changes from non-undefined to undefined, it doesn't work unless you specify its field like <template is="temp" data="{{{ ...obj, value: obj.value }}}" />.
<template is="temp" data="{{{ ...obj }}}" />
obj
<template is="temp" data="{{{ ...obj, value: obj.value }}}" />
swanide://fragment/c44d02fd72c5c1f011dccf3f91ef089e1669272840476
Open the link on Baidu dev tool, and click the button on page to see UI changes.
Some fields may fails to update during page rerendering.
https://user-images.githubusercontent.com/1812118/203714962-d8eb1ffe-c7e7-4efc-8308-26e8d302694c.mp4
We have to specify the field manually.
https://github.com/airbnb/goji-js/blob/8542d995892c30f02fe56967581942dd7f3d79fe/packages/webpack-plugin/src/templates/components/item.wxml.ts#L13-L15
https://github.com/airbnb/goji-js/pull/180 Introduced a new variable meta to store all data that an elment needed, and this issue was passed by.
meta
Description
For data in template
<template is="temp" data="{{{ ...obj }}}" />
, when value inobj
changes from non-undefined to undefined, it doesn't work unless you specify its field like<template is="temp" data="{{{ ...obj, value: obj.value }}}" />
.Reproduct link
swanide://fragment/c44d02fd72c5c1f011dccf3f91ef089e1669272840476
Reproduct steps
Open the link on Baidu dev tool, and click the button on page to see UI changes.
Impact
Some fields may fails to update during page rerendering.
https://user-images.githubusercontent.com/1812118/203714962-d8eb1ffe-c7e7-4efc-8308-26e8d302694c.mp4
Temporary solution
We have to specify the field manually.
https://github.com/airbnb/goji-js/blob/8542d995892c30f02fe56967581942dd7f3d79fe/packages/webpack-plugin/src/templates/components/item.wxml.ts#L13-L15
Platforms