Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ios-feature-20170118' into dev-release095
- Loading branch information
Showing
129 changed files
with
4,452 additions
and
1,600 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
...ponent/slider-neighbor/silder-neighbor.we → examples/component/slider-neighbor/index.we
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<template> | ||
<scroller> | ||
<wxc-panel title="websocket" type="primary"> | ||
<input | ||
type="text" | ||
placeholder="please input message to send" | ||
class="input" | ||
autofocus="false" | ||
value="" | ||
onchange="onchange" | ||
oninput="oninput" | ||
id = "input" | ||
/> | ||
<div style="flex-direction: row; justify-content: center;"> | ||
<wxc-button value="connect" size="small" type="primary" onclick="{{connect}}"></wxc-button> | ||
<wxc-button value="send" size="small" onclick="{{send}}" type="primary" style="margin-left:20px;"></wxc-button> | ||
<wxc-button value="close" size="small" onclick="{{close}}" type="primary" style="margin-left:20px;"></wxc-button> | ||
|
||
</div> | ||
|
||
<wxc-panel title="method = send"> | ||
<text>{{sendinfo}}</text> | ||
</wxc-panel> | ||
|
||
<wxc-panel title="method = onopen"> | ||
<text>{{onopeninfo}}</text> | ||
</wxc-panel> | ||
|
||
<wxc-panel title="method = onmessage"> | ||
<text>{{onmessage}}</text> | ||
</wxc-panel> | ||
|
||
<wxc-panel title="method = onclose"> | ||
<text>{{oncloseinfo}}</text> | ||
</wxc-panel> | ||
|
||
<wxc-panel title="method = onerror"> | ||
<text>{{onerrorinfo}}</text> | ||
</wxc-panel> | ||
|
||
<wxc-panel title="method = close"> | ||
<text>{{closeinfo}}</text> | ||
</wxc-panel> | ||
</wxc-panel> | ||
</scroller> | ||
</template> | ||
|
||
<style> | ||
.input { | ||
font-size: 40px; | ||
height: 80px; | ||
width: 600px; | ||
} | ||
</style> | ||
|
||
<script> | ||
require('weex-components'); | ||
var navigator = require('@weex-module/navigator'); | ||
var modal = require('@weex-module/modal'); | ||
var websocket = require('@weex-module/webSocket'); | ||
module.exports = { | ||
data: { | ||
connectinfo: '', | ||
sendinfo: '', | ||
onopeninfo: '', | ||
onmessage: '', | ||
oncloseinfo: '', | ||
onerrorinfo: '', | ||
closeinfo: '', | ||
txtInput:'', | ||
navBarHeight: 88, | ||
title: 'Navigator', | ||
dir: 'examples', | ||
baseURL: '', | ||
}, | ||
methods: { | ||
connect:function() { | ||
websocket.WebSocket('ws://115.29.193.48:8088',''); | ||
var self = this; | ||
websocket.onopen = function(e) | ||
{ | ||
self.onopeninfo = e; | ||
} | ||
websocket.onmessage = function(e) | ||
{ | ||
self.onmessage = e.data; | ||
} | ||
websocket.onerror = function(e) | ||
{ | ||
self.onerrorinfo = e.data; | ||
} | ||
websocket.onclose = function(e) | ||
{ | ||
self.onerrorinfo = e.code; | ||
} | ||
}, | ||
send:function(e) { | ||
var input = this.$el('input'); | ||
input.blur(); | ||
websocket.send(this.txtInput); | ||
this.sendinfo = this.txtInput; | ||
|
||
}, | ||
oninput: function(event) { | ||
this.txtInput = event.value; | ||
}, | ||
close:function(e) { | ||
websocket.close(); | ||
}, | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
ios/playground/WeexDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.