Comments (8)
@Z-Janp ,You should install weex-bindingx
by:
npm install weex-bindingx --save
and then you can import&use it:
import BindingX from weex-bindingx;
...
BindingX.bind();
from bindingx.
@Rowandjj yeah, I did do that.
"typeof callNative !== 'function'" which is inside the package
node_modules/universal-env/lib/index.js
from bindingx.
@Z-Janp well, so the problem is universal-env#isWeex
return false ?
as far as I know, in the latest version of weex,callNative
is moved,so you cannot use that to determine whether weex is exists or not. Instead you should use WXEnvironment
.
The newest version of universal-env
has already solved the problem:
//https://github.com/alibaba/rax/blob/master/packages/universal-env/src/index.js
export const isWeex = typeof callNative === 'function' || typeof WXEnvironment === 'object';
So update universal-env
should solve the problem. Or you can degrade your weex_sdk to the old version too.
Hope it helps, ths:)
====
updated:
btw, universal-env
is designed for rax and should not use in vue.
from bindingx.
Yes, that is what I want to express.
but, I found that weex-bindingx relies on universal-env.
And, I have upgraded universal-env. But they haven't pushed the latest code to the npm repository.
I'm just wondering why weex-bindingx depends on universal-env.
Your answer is helpful.
Thx u!!!
from bindingx.
@Z-Janp In fact weex-bindingx
is not rely on universal-env at all.
Because we have a web polyfill version of bindingx which can run on browser, however, findDomNode
API is difference between weex and web. So you can see this function in our demos:
function getEl(el) {
return isWeex ? findDOMNode(el).ref : findDOMNode(el);
}
=====
As for your problem, there are some ways to go out:
- Use
universal-env#isWeb
variable to do the same thing. - Implement
isWeex
yourselflet isWeex = typeof callNative === 'function' || typeof WXEnvironment === 'object';
- If you do not need to compatible with html5, just remove
isWeex
.
ths:)
from bindingx.
I see.
But, This is not work.
let isWeex = typeof callNative === 'function' || typeof WXEnvironment === 'object';
in the latest version of weex,callNative is moved
Similarly, there is no callNative on the web.
But, WXEnvironment is a valid object in the web.
so...This kind of judgment logic is problematic.
from bindingx.
@Z-Janp umm, I found that too. The Rax team will figure that out later.
For now, use isWeb
maybe the best option for you.
from bindingx.
ok, thx again!
from bindingx.
Related Issues (20)
- WebBinding.bind is not a function.
- 弃坑了吗? HOT 1
- 陀螺仪
- 官网的Demo示例挂了 HOT 3
- 分段函数的表达式该如何描述? HOT 2
- 用于工程原因,不能使用cocoaapods,直接编译framework不起作用,请问该如何注册呢 HOT 2
- 按照官网步骤Weex集成冲突 HOT 3
- 官网demo打不开了 HOT 5
- rax 的 demo 一个都跑不起来 HOT 1
- 在uniapp中使用weex-bindingx,color属性绑定evaluateColor api改变不了颜色 HOT 2
- 执行bindingx动画之后,有什么办法恢复成原来未执行的状态吗? HOT 1
- What is `anchor` if listening to window scroll events HOT 2
- Android weex 0.28 替换了包名 HOT 3
- 请问prepare方法如何使用 HOT 1
- react-native bind scroller 横向滚动失败
- react-native-bingingx 不支持目标属性 height 的变化
- 对于weex 0.28.0版本的android的bindingx有做适配吗? HOT 3
- weex 升级到0.28 后,Android 版本bindingx 只有 1.0.1 可用,其他的都无反应
- 官网的rax demo全都打不开 HOT 3
- react-native-bindingx
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bindingx.