+ [ios] update demo @notdanger
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8c1bd671 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8c1bd671 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8c1bd671 Branch: refs/heads/0.16-dev Commit: 8c1bd671e79f0f0422ef52b193ea8767c89ad279 Parents: a06d378 Author: é½å±± <sunjjb...@163.com> Authored: Wed Jul 19 15:05:35 2017 +0800 Committer: é½å±± <sunjjb...@163.com> Committed: Wed Jul 19 15:05:35 2017 +0800 ---------------------------------------------------------------------- examples/vue/components/input.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8c1bd671/examples/vue/components/input.vue ---------------------------------------------------------------------- diff --git a/examples/vue/components/input.vue b/examples/vue/components/input.vue index 4c3ea37..ab950a4 100644 --- a/examples/vue/components/input.vue +++ b/examples/vue/components/input.vue @@ -4,6 +4,8 @@ <text style="font-size: 40px">oninput: {{txtInput}}</text> <text style="font-size: 40px">onchange: {{txtChange}}</text> <text style="font-size: 40px">onreturntype: {{txtReturnType}}</text> + <text style="font-size: 40px">selection: {{txtSelection}}</text> + </div> <scroller> <div> @@ -124,6 +126,7 @@ </div> <div style="flex-direction: row;margin-bottom: 16px;justify-content: space-between"> <text class="button" value="setRange" type="primary" @click="setRange"></text> + <text class="button" value="getSelectionRange" type="primary" @click="getSelectionRange"></text> </div> <input type="text" ref="inputselection" placeholder="please input" value="123456789" class="input" @change="onchange" @return = "onreturn" @input="oninput"/> </div> @@ -194,6 +197,13 @@ setRange: function() { console.log(this.$refs["inputselection"]); this.$refs["inputselection"].setSelectionRange(2, 6); + }, + getSelectionRange: function() { + console.log(this.$refs["inputselection"]); + var self = this; + this.$refs["inputselection"].getSelectionRange(function(e) { + self.txtSelection = e.selectionStart +'-' + e.selectionEnd; + }); } } };