dcloudio / dcloudio/native-docs

nvue 中的 bindingx 只要含有 rgba 则不生效

Open
#120 0 comments 0 reactions 1 assignee Claimed by @st-dc View on GitHub
Dominant language
No language data
Stars
88
Forks
75
PR merge metrics
No merged PRs in 30d

Description

代码如下:
```




{{item.text}}



header

const bindingX = uni.requireNativePlugin('bindingx')

export default {
data() {
const lists = []
for (let i = 0; i < 100; i++) {
lists.push({
id: i,
text: i,
})
}
return {
lists,
}
},
mounted() {
setTimeout(()=>{
bindingX.bind({
anchor: this.$refs.list.ref,
eventType: 'scroll',
props: [
{
element: this.$refs.header.ref,
property: 'background-color',
expression: `rgba(0,0,0,y<20?0.5:0.5-(((y-20)/200>0.5?0.5:(y-20)/200)))`,
},
{
element: this.$refs.text.ref,
property: 'color',
expression: `rgba(y<120?255:51,y<120?255:51,y<120?255:51,y<20?1:(y<120?(1-(((y-20)/100>1?1:(y-20)/100))):(y>220?1:(y-120)/100)))`
},
],
})
}, 500)
},
}

```

**HBuilderX 3.5.3.20220729** 版本中,以上代码运行后,只要`expression`含有`rgba`,则无效,视频如下:
https://vkceyugu.cdn.bspapp.com/VKCEYUGU-2990ed4f-051f-4f15-9beb-2cc68d0c4a77/0741aa05-b70d-4072-9a6f-f0a2f66349dd.mp4

https://user-images.githubusercontent.com/17996289/184844904-1a57fe1b-11e1-45c6-87f9-951864501479.mp4

但是在**HBuilderX 3.4.7.20220422** 版本中,则运行正常,视频如下:
https://vkceyugu.cdn.bspapp.com/VKCEYUGU-2990ed4f-051f-4f15-9beb-2cc68d0c4a77/b69c160c-ef2e-4fb3-995f-2ee2b276771c.mp4

https://user-images.githubusercontent.com/17996289/184844921-f54054c9-85e1-42a6-881d-d4658c50c189.mp4

请问是什么问题导致?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.