Coder Social home page Coder Social logo

alibaba / bindingx Goto Github PK

View Code? Open in Web Editor NEW
1.3K 54.0 110.0 11.53 MB

:rocket: Bind actions to effects.

Home Page: https://alibaba.github.io/bindingx/

License: Other

Ruby 0.07% Java 12.09% Objective-C 9.31% HTML 0.33% JavaScript 77.18% Vue 1.02%
android ios weex react-native design ui interactive

bindingx's Introduction

BindingX_250.png

BindingX

Join the chat at https://gitter.im/alibaba/bindingx

image | left image | left CircleCI

A new interaction way based on weex & react native & html5 .

It provides a way called expression binding for handling complex user interaction with views at 60 FPS in React Native and weex 🎉 🎉 🎉 .

Description

The async nature of the js-native bridge in react native and weex incurs an inherent performance penalty. This traditionally prevents JavaScript code from running at high framerates.

We exploreed and implemented a completely new approach to solve the problem. It's main idea is translate the user interaction into expression, and transfer those expressions into native environment. When events occurs (events such as user gesture), all computing task is running on the native side, NO redundant js-bridge calls any more. Read More

Glance

Below are some examples which is using bindingx. You can get more examples by running our playground app. Or you can write your own example use our online playground, have fun:)

Demo examples

  1. pan gesture: rax vue rn
  2. timing: rax vue rn
  3. scroll: rax vue rn
  4. orientation: rax vue rn

RealLife examples

  1. Draggable ball: rax vue
  2. Swipeable card: rax vue
  3. Expandable menu: rax vue
  4. Slide layout: rax vue
  5. Circle menu: rax vue
  6. Navigation with Tab: rax vue
  7. Ripple effect: rax vue

Note: Weex has two DSL (rax & vue). The link is jumping to JS-Playground. But now our JS-Playground not support React-Native code, so it is jumping to plain source code.

You can also contribute your examples to us by open an pull request. And we will display your example here if it's cool enough.

Feature

  • Complex but fluid user interaction
  • Powerful expression parsing engine
  • Plenty of easing functions

Installation

Weex

Prerequisites: integrate weex sdk to your application.

Android

We provide two ways to integrate bindingx plugin.

  1. manual integration

    • add dependencies in your application's build.gradle

      implementation 'com.alibaba.android:bindingx-core:1.0.1'
      implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.1'
      
    • register bindingx plugin in code. (Application#onCreate, for example)

      BindingX.register()
      
  2. use weex plugin loader

    • add dependencies in your application's build.gradle

      implementation 'com.alibaba.android:bindingx-core:1.0.1'
      implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.1'
      implementation 'org.weex.plugin:plugin-loader:1.0.0'
      
    • register bindingx plugin use plugin loader.

      WeexPluginContainer.loadAll(getApplicationContext());
      

iOS

add dependencies in your application's Podfile

  pod 'BindingX', '~> 1.0.3'

module will be registed automatically by WeexPluginLoader, also you can use weex standard module register api [WXSDKEngine registerModule:@"bindingx" withClass:NSClassFromString(@"EBWXModule")].

React Native

Prerequisites: integrate react native to your application.

  1. install dependencies: npm install react-native-bindingx --save;
  2. link library: react-native link react-native-bindingx;

Android

add bindingx-core library to build.gradle manually:

implementation 'com.alibaba.android:bindingx-core:{latest_version}'
  1. migrate to android gradle plugin 3.0;
  2. use implementation instead of compile in your build.gradle;
  3. add google repository to your root build.gradle:
repositories {
  google()
  ...
}

Who is using

taobao tmall youku fliggy
Taobao tmall youku fliggy

Contributing

  • Any PR is welcome
  • Dingding chat group.

Snip20180115_20.png | left | 229x229

License

Copyright 2018 Alibaba Group

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

bindingx's People

Contributors

alibaba-oss avatar gitter-badger avatar hjhcn avatar huxiaoqi567 avatar rowandjj avatar tw93 avatar wispy316 avatar wjun94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bindingx's Issues

Can we support the plugin via weex-toolkit?

Hi ~ All
Thank you for contributing such a wonderful component, and as the title describes, the weex plugin feature has undergone a version change not long ago, and you can manage your plugins using weex plugin [add|remove|update] [pluginname] command in your project, some plugins have been supported for this model, such as natjsweex-plugin-lottie, maybe you can support it as well.
More detail about how to publish or develop a plugin, you can see how-to-devloping-weex-plugin.
If you have any questions we can discuss below this issue.
Thanks.

react-native-bindingx

Calling synchronous methods on native modules is not supported in Chrome.
可以增加异步方法吗?

iOS使用cocoapods问题

我的项目是混编项目,因此使用Podfile使用
use_frameworks!
由于BindingX依赖于静态库PluginLoader 导致pod install过不了

虽然使用以下
pre_install do |installer|

workaround for CocoaPods/CocoaPods#3289

Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
可以使pod install通过,但是编译出来的BindingX并不能用,只用在pod target强制将库mach-o改为static才能用。

建议在podspec做修改,让使用use_frameworks!的开发者可以直接使用

背景颜色问题

最近接入bindingx,遇到一些实际运用上的问题,请教如何解决。

想要达到的效果:
计算scroll的Y值,达到某个值时,改变指定元素的背景色(不需要渐变)。

有问题的代码:
_this.bindingObject[i] = G_BINDING.bind({
anchor : _this.$refs['scroll_nav'].ref,
eventType : 'scroll',
props:[{
element: _this.$refs[456].ref,
expression : 'y < 1000 ? #000000 : #ffffff',
property : 'background-color'
}]
},function(state,x,y){
G_BINDING.getComputedStyle(_this.$refs[456]);
})

无法实现对应的效果。请问是我哪里写错了吗,expression里面是否有问题

index.js:876 Uncaught SyntaxError: Unexpected token --

There is no problem with the first binding and this error occurs the second time。
If you remove the second configuration in the props, then normal(第一次绑定没有问题,第二次出现这个错误,如果去掉props中的第二个配置,则正常)

code show as below:
`
this.isInAnimation = true;

    this.showScrollBar();

    const beginTime = new Date().getTime();

    const instance = this.swipeInstance;

    const translate_y_origin = `y+${this.y}`;

    //滚动条的高度和滚动区域比例
    const bl = instance.scrollBarStyle.height / instance.swipeableStyle.height;
    
    const translateScrollBarOrigin = `0-(y/3-${this.y * bl})`;

    const scrollView = getEl(instance, SWIPEABLE_CONTAINER_REF_NAME);

    const gesTokenObj = Binding.bind({
        anchor: scrollView,
        eventType: 'pan',
        props: [
            {
                element: scrollView,
                property: 'transform.translateY',
                expression: translate_y_origin
            },
            {
                element: getEl(instance, SCROLL_BAR_PROGRESS_REF_NAME),
                property: 'transform.translateY',
                expression: translateScrollBarOrigin
            }
        ]
    }, (e) => {
        if (e.state === 'end') {
            this.handleTouchEnd(e, beginTime);
        }
    });
    this.gesToken = gesTokenObj.token;`

The demo gives an error

Demo examples > scroll > vue: https://jsplayground.taobao.org/vueplayground/ca7bef18-ce30-4e00-9a41-746b8646348b.

Is it working in progress or did I miss something?

VM2771 about:srcdoc:52 执行代码错误 Script error.
window.onerror @ VM2771 about:srcdoc:52
x @ index.min.js:1
E @ index.min.js:1
N @ index.min.js:1
O.r._scrollHandler @ index.min.js:1
(anonymous) @ vue.min.js:6
te @ vue.min.js:6
error (async)
(anonymous) @ VM2771 about:srcdoc:51
VM2773:5705 Uncaught TypeError: _vm.onappear is not a function
    at appear (eval at window.evalCode (VM2771 about:srcdoc:7), <anonymous>:5705:36)
    at t (vue.min.js:6)
    at HTMLElement.e._withTask.e._withTask (vue.min.js:6)
    at x (index.min.js:1)
    at E (index.min.js:1)
    at N (index.min.js:1)
    at a.O.r._scrollHandler (index.min.js:1)
    at Array.<anonymous> (vue.min.js:6)
    at te (vue.min.js:6)

property: 'width',过一段时间动画失效

eventType: 'timing',
exitExpression: {
origin: 't>750'
},
props: [
{
element: vm.getEl(vm.$refs.demo),
property: 'width',
expression: {
origin: 'linear(t, 700, -700, 750)'
}
}
]
触发动画后,等待一段时间(大概五六秒),再触发动画失效

pan 手势第一次快速滑动元素 bind 不成功

demo 地址
官网demo
https://jsplayground.taobao.org/raxplayground/7ac0f12b-72e7-4aa5-b398-693ba7b34cd6
我的例子
https://jsplayground.taobao.org/vueplayground/b2e271e0-f751-4676-8de5-eb506dd671ce

结合实际使用过程中的体验,发现 pan 手势的触发存在一些问题。
在第一次快速滑动元素时会有 bind 不成功的情况,通过在 bind 函数前后和回调函数里面打印日志观察发现, bind 函数前后两个日志打印是成功了的,在回调函数里面的打印日志没有成功。
我是用的是 AppStore 上下载的 BindingX playground 调试的,手机型号 iPhone 6 iOS 11.3.1 没有试过 android 手机的情况。

Android Error

当我加入

implementation 'com.alibaba.android:bindingx-core:1.0.1'
implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.1'

编译报错

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

去掉

implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.1'

就不报错,编译通过

object-c项目cocoapods引入问题

object-c项目,cocoapods使用use_frameworks! 方式引入weex sdk和binging,
platform :ios,'8.0' use_frameworks! target 'JingPin' do

执行pod install时报错
[!] The 'Pods-JingPin' target has transitive dependencies that include static binaries: (/Users/yiguomac/Desktop/JingPinGit/JingPin/Pods/WeexPluginLoader/WeexPluginLoader.framework)

getComputedStyle接口返回的属性与真实的变换属性的关系是什么?

使用getComputedStyle返回的参数,其中的rotateZ显示为70,实际旋转角度为90deg, 这两个值的对应关系为啥?有没有大神知道?

image

角度对应:
0deg => 0
90deg => -70
180deg => 129
270deg => -97
360deg => -68

想要在unbind停止动画后知道目前的旋转角度,但是getComputedStyle拿到的值太玄乎。。。。。。。

发现一遇到90的倍数就回抖动。。。。
image

pod install 报错

object-c 项目
CocoaPods版本 1.5.0
pod 本地仓库已更新至最新

pod install的时候提示
yiguomac:Weex yiguomac$ pod install
Analyzing dependencies
Downloading dependencies
Installing BindingX (1.0.1)
Using SDWebImage (4.3.1)
Installing WeexPluginLoader (0.0.1.9.1)
Using WeexSDK (0.18.0)
[!] The 'Pods-Weex' target has transitive dependencies that include static binaries: (/Users/yiguomac/Desktop/WeexDemoGit/WeexDemo/platforms/ios/Weex/Pods/WeexPluginLoader/WeexPluginLoader.framework)

transformed 属性

首先感谢开源这么 awesome 的项目,而在使用中看到 expression 的 transformed 类似是就是编译后的
CallNative 的指令,使用起来较复杂,文档缺没有过多教程,能否通过一层转化 更简化一些,或者尽快完善下文档。

文档过期?

以下文档内的演示程序跑不起来:

  1. https://alibaba.github.io/bindingx/guide/cn_guide_gesture,手机里正常显示界面,但无法手势操作。

    其它问题:BindingX.bind返回undefined, 自然取不到token

    为解决上述问题,尝试了以下做法,但没有效果:
    1.1 在componentDidMount里BindingX.prepare无效
    1.2 使用 getEl(this.refs.my) 无效

  2. https://alibaba.github.io/bindingx/demos 里的“吸边拖动小球rax" "横滑卡片rax" "侧滑布局rax" "带有tab切换的导航栏”,在playground里能正常显示界面, 但无法手势操作。

请问文档是否过期了?

expression engine support one single variable as an expression

<template>
  <div style="flex: 1;">
    <scroller ref="top" scroll-direction="horizontal" class='top'>
      <text class="text" v-for="(text, index) in items">{{text + ' -----  ' + index}}</text>
    </scroller>
    <scroller ref="content" scroll-direction="horizontal" class="content">
      <text class="text" v-for="(text, index) in items">{{text + ' -----  ' + index}}</text>
    </scroller>
  </div>
</template>

<script>
  import BindingX from 'weex-bindingx';

  export default {
    data(){
      return {
        items: ["123", "234", "234", "234", "234", "234", "234", "234", "234", "234", "234", "234", "234", "234", "234"],
      }
    },
    created() {
    },
    mounted() {
      this.binding();
    },
    methods: {
      binding(e) {
        const top = this.$refs.top.ref;
        const content = this.$refs.content.ref;

        var result = BindingX && BindingX.bind({
           eventType: 'scroll',
           anchor: content,
           props: [
             {
               element: top,
               expression: "x",
               property: "scroll.contentOffsetX"
             }
           ] 
        }, (e) => {});
      }
    }
  }
</script>

<style>
  .top {
    width: 750px;
    height: 100px;
    background-color: #f0f;
    align-items: center;
  }
  .content {
    margin-top: 100px;
    width: 750px;
    height: 300px;
    background-color: #456;
    align-items: center;
  }
  .text {
    background-color: #0ff;
    flex: 1;
    margin-left: 30px;
  }
</style>

expressionx时,scroller不能实现联动,但只要是一个完整的表达式就OK,比如: x + 0.1

bindingx invalid when used on component

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>

rn

插件啥时候上传到npm啊 rn装不上

bind scroller 横向滚动失败

当设置scroller的scroll-direction为horizontal时,bind会失败 报错 E/ExpressionBinding: expression enabled failed. [token:4784,type:scroll] E/ExpressionBinding: internal error.binding failed for ref:4784,type:scroll

WeexPlayground上扫描demo拖拽小球后报错

6: 2018-03-01 18:01:05.189 WeexDemo <Weex>[exception]bundleJSType:Rax
instanceId:2 bundleUrl:https://jsplayground.taobao.com/bundle/c907c1c9-6226-4a48-b931-3cba49f25b67/raxbundle.js?random=-458296630 errorCode:-9400 functionName: exception:[WX_KEY_EXCEPTION_WXBRIDGE] [undefined:4393:35] TypeError: undefined is not an object (evaluating 'gesTokenObj.token')
onPanStart
[email protected]:1:27187
[email protected]:1:162919
native-bundle-main.js:1:162994
forEach@[native code]
[email protected]:1:162671
native-bundle-main.js:1:255299 userInfo:{
    jsMainBundleStringContentLength = 216532;
    jsMainBundleStringContentMd5 = 21f7faf96dbf436cbac574bb7682b918;
} jsfmVersion:0.24.4 sdkVersion:0.18.0 appVersion:2.2 osVersion:11.2.6 platform:iOS deviceModel:iPhone10,2

If you want to know more, please open weex MNT

2421519898589_ pic

running error after install react-native-bindingx

Hello! There is a running problem when I just install the react-native-bindingx, I even hadn't import it.

The error message following:

error: bundling failed: ambiguous resolution: module `~/RNtest/index.js` tries to require `react-native`, but there are several files providing this module. You can delete or fix them: 

  * `~/RNtest/node_modules/react-native-bindingx/node_modules/react-native/package.json`
  * `~/RNtest/node_modules/react-native/package.json`

Thanks for help!

EBExpressionExecutor crash 率比较高

你好,我们【iOS】app 上线后发现以下crash比较高
1、[EBExpressionExecutor executeExpression:exitExpression:scope:] (EBExpressionExecutor.m:58)

具体的堆栈信息如附件
bindx_crash

universal-env#isWeex is not work correctly

if (isWeex) { /**/ } else { return WebBinding.bind(options, callback) }

logcat : ReportException : Exception: TypeError: WebBinding.bind is not a function.
typeof callNative !== 'function'

env: {
weexSDK: 0.18.0-beta-3
bindingx-core: 1.0.1
android: 6
}

Android project import failure

The following error occurred when importing bindingx into my Android project.

tim 20180526020510

I think it's the reason for the jar conflict, but I've been trying for a long time and I can't decide which package conflict is.

The following is the configuration I import

tim 20180526020736

怎么集成到weex init创建的android项目中呢

使用weex init创建的项目,已经添加android 平台,请问怎么将bindingx集成到这个项目中,readme里面写的并不能和weex创建的项目很好的兼容,出现各种问题

  1. Error:Execution failed for task ':app:processDebugResources'. Error: more than one library with package name 'com.alibaba.weex.plugin.loader'
    发现com.taobao.android:weexplugin-loader:1.3和'org.weex.plugin:plugin-loader:1.0.0'包的名字重复,删除之后构建,又出现Error:Error converting bytecode to dex:
    Cause: com.android.dex.DexException: Multiple dex files define Lcom/alibaba/weex/plugin/annotation/WeexAdapter;

为什么 unbind 没有 callback ?

希望官方为 unbind 添加 callback!

bindingx.bind({...}, function(e) {
  if (e.state === 'end' || e.state === 'exit') {
    // 这里是异步的,然而,我非常希望在 unbind 结束后
    // 才能操作某些数据
    // 怎么办??????
    bindingx.unbind({...});
  }
});

ReactNative中使用报错

我在ReactNative npm集成就报错了~
error: bundling failed: ambiguous resolution: module
tries to require react-native, but there are several files providing this module. You can delete or fix them:
*/node_modules/react-native-bindingx/node_modules/react-native/package.json
*
/node_modules/react-native/package.json

安卓上集成失败

我在安卓上安卓文档上的方式集成,使用的时候看不到效果,在iOS上能顺利使用。是什么原因啊?
集成方式:
build.gradle中添加依赖
classpath 'com.alibaba.android:bindingx-core:1.0.1'
classpath 'com.alibaba.android:bindingx_weex_plugin:1.0.1'
classpath 'org.weex.plugin:plugin-loader:1.0.0'
Weex加载

 WeexPluginContainer.loadAll(getApplicationContext());

界面实现代码
var result =
BindingX &&
BindingX.bind(
{
eventType: "scroll",
anchor: this.$refs["left-list-view"].ref;,
props: [
{
element: this.$refs["right-list-view"].ref,
expression: "y*1",
property: "scroll.contentOffsetY"
}
]
},
e => {}
);

android集成失败,找不到bindingX-core 和 plugin

build.gradle中添加依赖
implementation 'com.alibaba.android:bindingx-core:1.0.1'
implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.1'
编译报错
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.alibaba.android:bindingx-core:1.0.1.
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.alibaba.android:bindingx_weex_plugin:1.0.1.

[EBBindData parseExpression:] 解析表达式出错

81535511740_ pic_hd

描述上图所示:因为 NSJSONSerialization 解析 NSTaggedPointerString 类型的对象出现解析出错 导致返回的 expression 为空,因此无法正确绑定,错误信息如下:

Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.}

weex 端的代码如下:

bindingX() {
      const top = this.getEl(this.$refs.top) || null;
      const bottom = this.getEl(this.$refs.bottom) || null;
      console.log(top, '------------------mounted-------------', bottom);
      BindingX.bind(
        {
          eventType: 'scroll',
          anchor: bottom,
          props: [
            {
              element: top,
              property: 'scroll.contentOffsetX',
              expression: 'x + 0',
            },
          ],
        },
        e => {},
        d => {},
      );
    },

BindingX的版本为最新版,我主仓库上拉的。

weex plugin add bindingx-weex-plugin不可用

我在执行 weex plugin add bindingx-weex-plugin 时 出现 Not found : weex-plugin-bindingx-weex-plugin。
改为 weex plugin add bindingx 提示 This package of weex is not support anymore! Please choose other package.

请问哈字体颜色的表达式是什么呀

vm.$bindingx.bind({
eventType:'scroll',
anchor:list,
props:[
{
element:header,
property:'background-color',
expression:evaluateColor('#ffffff','#F65A44',min(y,200)/200)
},
{
element:headerText,
property:'color',
expression:evaluateColor('#000000','#ffffff',min(y,200)/200)
},

    ]

})

背景颜色都可以用,字体颜色的表达式是不是和背景颜色不一样啊

内存会越来越大

版本:com.alibaba.android:bindingx-core:1.0.2
我做了一个组件,可以画框、拖动、拉伸功能,但是随着次数增多,会变越来越卡(将近操作1小时发现),内存监听了一下会越来越大。我做了一个unbind操作,甚至unbindAll,发现没什么作用,我想问一下是什么引起的

BindingX.bind() return undefined.

env: {
BindingX: 1.0.0
WeexSDK: 0.18.0
}
[undefined:22246:50] TypeError: undefined is not an object (evaluating 'partCardGesTokenObj.token')
ontouchstart
panstart
[email protected]:1:27187
map@[native code]
native-bundle-main.js:1:255299 userInfo:{
jsMainBundleStringContentLength = 615802;
jsMainBundleStringContentMd5 = 9c6230950ec64116fb06aba15ef07f98;
} jsfmVersion:0.24.4 sdkVersion:0.18.0 appVersion:1.0.0 osVersion:11.2.2 platform:iOS deviceModel:iPhone9,1

help!!!

RN集成问题

我不知道我哪部操作不对,都是按着文档来的,然后ios的问题是

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
没办法正常运行.

android是Error:(156, 20) Failed to resolve: com.alibaba

expressionBinding

weex.requireModule('expressionBinding') 如果容器是不支持expressionBinding要怎么处理是要映入这个包吗?

this.el.addEventListener is not a function

The demo on the document is Rax.I use original weex-style and get the error.Here is the code: (css is the same and ignored)

<template>
  <div class="container" >
    <div class="border">
      <div ref="my" class="box" @panstart="touchstart">
        <div class="head">
          <div class="avatar"></div>
          <text class="username">Foo</text>
        </div>
        <div class="content">
          <text class="desc">Weex is a framework for building Mobile cross-platform UI. Rax is a universal JavaScript library with a largely React-compatible API.</text>
        </div>
        <div class="footer">
          <text class="action">SHARE</text>
          <text class="action" :style="{color:'#7C4DFF'}">EXPLORE</text>
        </div>
      </div>
    </div>
  </div>
</template>
import BindingX from 'weex-bindingx';

export default {
  methods:{
    touchstart(e){
      const my = this.$refs.my;
      var gesTokenObj = BindingX.bind({
          anchor:my,
          eventType:'pan',
          props: [
              {
                element:my, 
                property:'transform.translateX',
                expression:'x+0'
              }
            ]
        }, function(e) {
          // nope
        });
     this.gesToken = gesTokenObj.token;
    }
  }
}

and get:
image

IOS,swift安装bindingX,出现错误

您好,我使用XCODE 10,用swift和weex来编写app。当我尝试在项目中添加bindingX时,出现以下错误。

pod file如下:
platform :ios, '9.0'

target 'TestApp' do

Comment the next line if you're not using Swift and don't want to use dynamic frameworks

use_frameworks!
pod 'WeexSDK', '0.18.0'
pod 'SDWebImage', '3.7.5'
pod 'SocketRocket', '0.4.2'
pod 'Alamofire', '~> 4.7'
pod 'AFNetworking', '~> 2.0'
pod 'MBProgressHUD', '~> 1.1.0'
pod 'IoniconsKit'
pod 'RAMAnimatedTabBarController'
pod 'BindingX', '~> 1.0.0'

Pods for CReader

end

错误如下:
The 'Pods-TestApp' target has transitive dependencies that include static binaries: (/Users/james/400--MyProjects/430-IOS/431-swift practice/TestApp/Pods/WeexPluginLoader/WeexPluginLoader.framework)

有JR知道怎么解决吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.