component2.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view class="component2">
  3. <view class="box2" hover-class="box2-pressed">
  4. <view class="box" hover-class="box-pressed" hover-stop-propagation>
  5. I am box
  6. </view>
  7. </view>
  8. <button size="default">Button1</button>
  9. <button size="mini">Button2</button>
  10. <button class="button" plain>Button3</button>
  11. <button loading="true">Button5</button>
  12. <view>
  13. <image src="http://destiny001.gitee.io/image/cxk.gif" mode="aspectFill"/>
  14. <image src="http://destiny001.gitee.io/image/cxk.gif" mode="aspectFit" />
  15. <scroll-view>
  16. </scroll-view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. components: {},
  23. data: () => ({}),
  24. computed: {},
  25. methods: {},
  26. watch: {},
  27. // 页面周期函数--监听页面加载
  28. onLoad() {},
  29. // 页面周期函数--监听页面初次渲染完成
  30. onReady() {},
  31. // 页面周期函数--监听页面显示(not-nvue)
  32. onShow() {},
  33. // 页面周期函数--监听页面隐藏
  34. onHide() {},
  35. // 页面周期函数--监听页面卸载
  36. onUnload() {},
  37. // 页面处理函数--监听用户下拉动作
  38. onPullDownRefresh() {
  39. uni.stopPullDownRefresh();
  40. },
  41. // 页面处理函数--监听用户上拉触底
  42. onReachBottom() {},
  43. // 页面处理函数--监听页面滚动(not-nvue)
  44. /* onPageScroll(event) {}, */
  45. // 页面处理函数--用户点击右上角分享
  46. /* onShareAppMessage(options) {}, */
  47. };
  48. </script>
  49. <style>
  50. .component2 {
  51. width: 100vw;
  52. height: 100vh;
  53. }
  54. .box {
  55. width: 100rpx;
  56. height: 100rpx;
  57. background: green;
  58. }
  59. .box-pressed {
  60. background: red;
  61. }
  62. .box2 {
  63. width: 200rpx;
  64. height: 200rpx;
  65. background: pink;
  66. }
  67. .box2-pressed {
  68. background: burlywood;
  69. }
  70. .button{
  71. background: green;
  72. color: green;
  73. }
  74. </style>