Blogger Information
Blog 26
fans 0
comment 0
visits 21450
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
uni常用的事件
default
Original
724 people have browsed it
  1. <template>
  2. <view class="content">
  3. <view class="" >
  4. <input
  5. style="background: #008000;"
  6. type="text"
  7. @input="input"
  8. @blur="blur()"
  9. @focus="focus()"
  10. @confirm="confirm"
  11. @click="click"
  12. @tap="tap"
  13. @longpress="logpress()"
  14. >
  15. <br>
  16. <br>
  17. <br>
  18. <br>
  19. <button type="default"
  20. @touchstart="touchstart"
  21. @touchend="touchend"
  22. @touchmove="touchmove"
  23. @touchcancel="touchcancel"
  24. >触摸测试 </button>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {}
  32. },
  33. methods: {
  34. input(){
  35. console.log("input的val")
  36. },
  37. blur(){
  38. console.log("失去了焦点")
  39. },
  40. focus(){
  41. console.log("获取了焦点")
  42. },
  43. confirm(){
  44. console.log('回车')
  45. },
  46. click(){
  47. console.log('单机事件')
  48. },
  49. tap(){
  50. //手机端的触摸事件优先级比click高
  51. console.log('手机端的点击事件')
  52. },
  53. logpress(){
  54. console.log('手机端的长按事件')
  55. },
  56. touchstart(){
  57. console.log('触摸开始')
  58. },
  59. touchend(){
  60. console.log('触摸结束')
  61. },
  62. touchmove(){
  63. console.log('触摸移动')
  64. },
  65. touchcancel(){
  66. console.log('触摸被打断')
  67. }
  68. }
  69. }
  70. </script>
  71. <style>
  72. </style>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post