hanks10100 / weex-native-directive Goto Github PK
View Code? Open in Web Editor NEWWeex native directive design
Weex native directive design
我这边直接0.16版测试过,发现例子展示出来的数据不对。想问下大概什么时候能有稳定出来?
运行时报 TypeError: Cannot read property 'label' of undefined
at Ot.render (0658e5ec6c1d83e8c19adde7e0b2a0fa.bundle.vue.js:714)
at Ot.e._render (vue.min.js:6)
at Ot.r (vue.min.js:6)
at Uo.get (vue.min.js:6)
at new Uo (vue.min.js:6)
at Se (vue.min.js:6)
at Ot.$mount (vue.min.js:6)
at Ot.$mount (vue.min.js:6)
at Ot.e._init (vue.min.js:6)
at new Ot (vue.min.js:6)
Using callbacks to support filters in the template.
<text>{{ item.title | i18n }}</text>
Should be compiled to:
{
type: 'text',
attrs: {
value: {
'@binding': 'item.title'
'@filters': [i18n]
}
}
The i18n
is a function, and it'll be converted into a callback id when sending to native. Native render engines should get the value of item.title
and pass it to the callbacks which are defined in @filters
.
Source:
<div :style="{ fontSize: 15, color: item.color }"></div>
Should be compiled to:
{
style: {
fontSize: 15,
color: { '@binding': 'item.color' }
}
}
Current is:
{
style: {
'@binding': '{ fontSize: 15, color: item.color }'
}
}
can use section? can use section header and support sticky?
英文不知道怎么说了。就是自动顶上去的效果,现在的list的sticky对象是覆盖的!
@click事件是可以触发的,但是click的传参到放里面变成undefinedle了,能解决吗?
Unknown custom element: < recycle-list > - did you register the component correctly? For recursive components, make sure to provide the "name" option.
我用weex-toolkit 建了一个新页面,然后在里面使用了 recycle-list这个组件,编译时顺利通过,运行时会提示以上的错误。
运行: weex --version 查到的版本信息如下:
v1.1.0-beta.6
<div :class="box.classList"></div>
Will be compiled to:
{
type: 'div',
attrs: {
class: {
'@binding': 'box.classList'
}
}
}
Currently, class names and the stylesheet are managed in front-end frameworks and weex-js-runtime
. However, in this case, the result of box.classList
couldn't be got in front-end frameworks.
The stylesheet should be managed in native render engines.
when will the recycle-list support the Dom API scroolToElement, or providing another API to support scroll to specific height is also OK.
Currently it seems switch
and case
attributes (previously template-key
and template-type
) are always required, even when there is only one <cell-slot>
.
I think when there is only one <cell-slot>
, it should be used by default, so switch
and case
can be omitted:
<recycle-list for="item in longList">
<cell-slot>
<text>{{ item.foo }}</text>
</cell-slot>
</recycle-list>
Change the compiler to support the new syntax.
for
instead of the list-data
, alias
and index
.switch
instead of the template-key
.case
instead of the template-type
.Before:
<recycle-list :list-data="longList" template-key="cellType" alias="item" index="i">
<cell-slot template-type="A"> ... </cell-slot>
<cell-slot template-type="B"> ... </cell-slot>
</recycle-list>
After:
<recycle-list for="(item, i) in longList" switch="cellType">
<cell-slot case="A"> ... </cell-slot>
<cell-slot case="B"> ... </cell-slot>
</recycle-list>
The data of longList
still should be binding with the <recycle-list>
.
运行demo 直接报TypeError: undefined is not an object (evaluating '_vm.cell.count')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.