|
|
@@ -9,6 +9,12 @@
|
|
|
<view class="">
|
|
|
{{text}}
|
|
|
</view>
|
|
|
+ <view class="">
|
|
|
+ --------------------分割线-----------------------------
|
|
|
+ </view>
|
|
|
+ <view class="">
|
|
|
+ {{aaa}}
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -19,17 +25,19 @@ export default {
|
|
|
inputString: '',
|
|
|
inputCache: '',
|
|
|
text:'',
|
|
|
+ aaa:'',
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
onConfirm(text) {
|
|
|
- alert(JSON.stringify(text))
|
|
|
+ // alert(JSON.stringify(text))
|
|
|
console.log('拿到的text', text);
|
|
|
// 此处写我们自己的逻辑
|
|
|
this.text = text;
|
|
|
},
|
|
|
keypress(e) {
|
|
|
- alert(JSON.stringify(e))
|
|
|
+ this.aaa = JSON.stringify(e);
|
|
|
+ // alert(JSON.stringify(e))
|
|
|
if (e.keyCode === 66 || e.key === 'Enter') {
|
|
|
this.inputString = this.inputCache;
|
|
|
this.onConfirm(this.inputString);
|