A framework for building Mobile cross-platform UI
.we
), which is inspired by Vue 1.0, is deprecated. Although it still works well in this release, we suggest to migrate it to Vue 2.0.Drop support for iOS 7.X
New CSS support
text font-weight
font-weight
can set to [normal
|bold
] or 100-900.
gradient
like CSS3, now you can use gradient in Weex. For example:
background-image: linear-gradient(to right, blue, white);
Pseudo class
Currently, Weex supports 4 pseudo classes:active
, focus
, disabled
, enabled
.
New BroadcastChannel API
Developers can use BroadcastChannel
API to implement inter-instance communication.
const Stack = new BroadcastChannel('Avengers')
Stack.onmessage = function (event) {
console.log(event.data) // in this case, it's "Hulk Smash !!!"
}
// in another instance
const Hulk = new BroadcastChannel('Avengers')
Hulk.postMessage("Hulk Smash !!!")
Image's onload
event add naturalHeight
and naturalWidthimage
to get the original size of image file.
Websocket Support
WebSockets is an advanced technology that makes it possible to open an interactive communication session between the user's h5/iOS/android and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
Read more about Weex's websocket.
Support synchronous method call Both module and component method can defined synchronous method exposed to JS runtime now. Means native will invoke these method in JS thread directly.
Support viewport
configuration
Similar to W3C specification, Weex support set define viewport
in script tag:
<script type="config">
{
"viewport": {
"width": "device-width"
}
}
</script>
SDK
New API to get Component's size and position:
Now you can get these data through getComponentRect
:
var dom = require('@weex-module/dom');
dom.getComponentRect(this.$el('comp_id'), function(data){
if(data.result)
console.log(data);
});
The data
callback parameter contains a result
to tell if operation is success. And size
tell you the true data(bottom
/top
/left
/right
/width
/height
) of component.
A brand new picker
module. We have 'single-picker','date-picker' and 'time-picker' currently, and more common pickers are on the way.
There are two ways to use picker
picker
module directly:var picker = require('@weex-module/picker');
var self = this;
picker.pickDate({
'value':'2016-11-28',
'max':'2029-11-28',
'min':'2015-11-28'
},function (ret) {
var result = ret.result;
if(result == 'success')
{
self.value = ret.data;
}
});
input
component also add 'date' and 'timetype to work with
picker` module internally:<input
type="date"
placeholder="select date"
class="input"
autofocus="false"
value=""
onchange="onchange"
max = "2029-11-28"
min = "2015-11-28"
></input>
Support animation with width
and height
property.
Support use empty value to reset css property to default value.
Components can expose methods too, like modules do. Developers use the same way as create module method to achieve that.
Add blur
and focus
method to manually control input
component to lose or get focus.
Support relative URL, which will resolve real URL by bundle's URL.
Core javascript framework's unit test coverage is 100% now. we'll pay more attention to quality.
DevTool
width/height
animation in transitioncallAddElement
low-level API to make rendering fasterSet
polyfill to fix iOS7 memory leaksetProperty
replace reflection for better performancestatic
directive in default js framework to avoid unnecessary data-binding and take down the memory useimage
component's error page when src is invalidborder
,padding
,background-color
stylescrollto
apiposition:fixed
style can not be closedobject
paramssetIndex
apicallNative
signal to stop JSFM render after instance been destroyedweex-toolkit supports require and generator
Playground supports runtime performance viewer
Bugfix
Text
supports style text-overflow.Image
supports attribute resize.List
supports events appear
, disappear
, loadmore
and refresh.require('@weex-module/moduleName')
.