uniUI扩展组建

不包括基础组件,是基础组件的补充。
日历组件 Calendar
image.png
直接使用HBuilderX导入插件。
image.png
在组件里面将会有使用方式。
image.png

  1. <template>
  2. <view class="content">
  3. <test v-if="flag" :title='title' @myEvent='getNum'></test>
  4. <button type="default" @click="checkTest">切换test组件</button>
  5. 这是子组件传递过来的数据{{num}}
  6. <test-a></test-a>
  7. <test-b></test-b>
  8. <uni-calendar
  9. :insert="true"
  10. :lunar="true"
  11. :start-date="'2019-3-2'"
  12. :end-date="'2019-5-20'"
  13. @change="change"
  14. /></uni-calendar>
  15. </view>
  16. </template>
  17. <script>
  18. import test from '../../components/test.vue'
  19. import testa from '../../components/a.vue'
  20. import testb from '../../components/b.vue'
  21. import uniCalendar from '../../components/uni-calendar/uni-calendar.vue'
  22. export default {
  23. data() {
  24. return {
  25. title: 'Hello',
  26. flag:true,
  27. num:0
  28. }
  29. },
  30. onLoad(options) {
  31. console.log('页面加载了',options)
  32. },
  33. onShow(){
  34. console.log('页面显示了')
  35. },
  36. onReady() {
  37. console.log('页面初次渲染完成了')
  38. },
  39. onHide() {
  40. console.log('页面隐藏了')
  41. },
  42. methods: {
  43. checkTest(){
  44. this.flag = !this.flag
  45. }
  46. },
  47. components:{
  48. test,
  49. "test-a":testa,
  50. "test-b":testb,
  51. "uni-calendar":uniCalendar
  52. },
  53. methods:{
  54. getNum(num){
  55. this.num = num
  56. },
  57. change(e){
  58. console.log(e)
  59. }
  60. }
  61. }
  62. </script>
  63. <style>
  64. .content {
  65. display: flex;
  66. flex-direction: column;
  67. align-items: center;
  68. justify-content: center;
  69. }
  70. .logo {
  71. height: 200rpx;
  72. width: 200rpx;
  73. margin-top: 200rpx;
  74. margin-left: auto;
  75. margin-right: auto;
  76. margin-bottom: 50rpx;
  77. }
  78. .text-area {
  79. display: flex;
  80. justify-content: center;
  81. }
  82. .title {
  83. font-size: 36rpx;
  84. color: #8f8f94;
  85. }
  86. </style>

image.png