Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bindingx invalid when used on component #33

Closed
fengmingye opened this issue Jun 25, 2018 · 2 comments
Closed

bindingx invalid when used on component #33

fengmingye opened this issue Jun 25, 2018 · 2 comments

Comments

@fengmingye
Copy link

Page A include component B.
when i use bindingx on B,it is invalid.
Error msg: " E/ExpressionBinding: skip illegal binding args[null,opacity,com.alibaba.android.bindingx.core.internal.ExpressionPair@9c01d0da]"
The reason is in the Method onBindExpression,the fourth param expressionArgs does not has element!

Here is the code:

<style> .app { flex: 1; justify-content: center; align-items: center; background-color: #E0E0E0; } .list { flex-direction: column; overflow: hidden; width: 750; background-color: #f2f3f4; position: absolute; left: 0; top: 0; right: 0; bottom: 0; } .header_bg { width: 750; height: 500; } .header_bg_wrapper { width: 750; height: 600; position: absolute; top: 0; } .header { width: 750; height: 600; } .header_card { margin-top: 330; } .app_bar { width: 750; height: 250; position: absolute; top: 0; } .app_bar_bg { width: 750; height: 200; background-color: #03A9F4; position: absolute; top: 0; opacity: 0; } .card_wrapper { width: 750; height: 250; margin-top: 20; justify-content: center; align-items: center; background-color: transparent; } .card_content { border-radius: 25; width: 710; height: 250; background-color: #ffffff; } .nav_wrapper { width: 750; height: 100; align-items: center; background-color: transparent; flex-direction: row; } .nav_title { font-size: 35; font-weight: bold; margin-left: 250; color: #ffffff; } .nav_back { width: 40; margin-left: 20; height: 40; } .tab_wrapper_container { width: 750; height: 100; align-items: center; background-color: transparent; flex-direction: row; } .tab_wrapper { width: 125; height: 100; align-items: center; justify-content: center; } .tab { font-size: 25; color: #ffffff; } </style> <script> // const binding = weex.requireModule('bindingx'); //引入 bindingx import binding from 'weex-bindingx'; const ENHANCE = require('../enhance-vue') const _ = require('../async/_Vue.js') export default { components: { basePageWrapper: require('../components-vue/base-page-wrapper.vue'), customcomponent: require('../components-vue/common-header.vue'), }, data: { fake_tabs: [ 'Tab1', 'Tab2', 'Tab3', 'Tab4', 'Tab5', 'Tab6' ], }, mounted () { setTimeout(() => { this.headerBgBinding(); }, 2000) }, created: function () { ENHANCE.enhance(this) this.$onrefresh = _.create('onrefresh', true) .fetch('/app/customer/getUserInfoV3', {}, { silent: true }) .catch((e) => { this.$toast(e.msg) this.isLoadingUseInfo = true; }) .invoke() }, beforeDestroy () { this.headerBgBindingDestory(); }, methods: { headerBgBinding: function () { let self = this let scroller = self.$refs.contentScroller.ref let headerBg = self.$refs.headerBg1.ref; let bindingResult = binding && binding.bind({ eventType: 'scroll', anchor: scroller, props: [ { element: headerBg, property: 'opacity', expression: { origin: 'min(100,y)/100' } }, { element: headerBg, property: 'background-color', expression: { origin: "rgb(98,98,98)" } }, { element: headerBg, property: 'transform.translateY', expression: { origin: 'y<100?0:(0-min(y-100,100))' } } ] }, function (e) { }); self.gesToken = bindingResult.token; }, headerBgBindingDestory: function () { let self = this; if (self.gesToken != 0) { binding.unbind({ eventType: 'scroll', token: self.gesToken }) self.gesToken = 0; } } } } </script>
@Rowandjj
Copy link
Contributor

@fengmingye hi , please format your code or paste it to the playground: https://jsplayground.taobao.org/vueplayground

@Rowandjj
Copy link
Contributor

Rowandjj commented Jul 3, 2018

Hi, @fengmingye I'll close this issue for now because of no more active discussion. If your problem not solved, you can reopen it later.
Thanks.

@Rowandjj Rowandjj closed this as completed Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants