页面文件保存在src/pages/目录下
    文件中声明的页面实例继承自wepy.page类
    该类的主要属性如表6.3所示
    image.png

    1. <script>
    2. import wepy from 'wepy';
    3. import Counter from '../components/counter';
    4. export default class Page extends wepy.page {
    5. config = {};
    6. components = {counter1: Counter};
    7. data = {};
    8. methods = {};
    9. events = {};
    10. onLoad() {};
    11. // Other properties
    12. }
    13. </script>
    14. <template lang="wxml">
    15. <view>
    16. </view>
    17. <counter1></counter1>
    18. </template>
    19. <style lang="less">
    20. /** less **/
    21. </style>