base.html 922 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {extend name="public/base"/}
  2. {block name="css"}
  3. {/block}
  4. {block name="body"}
  5. <van-nav-bar
  6. class="nav-theme"
  7. :fixed="true"
  8. :placeholder="true"
  9. left-text="返回"
  10. left-arrow
  11. @click-left="onBack"
  12. >
  13. <template #title>
  14. <span class="text-white">首页</span>
  15. </template>
  16. </van-nav-bar>
  17. <van-tabbar v-model="active" @change="onTab" :placeholder="true">
  18. <van-tabbar-item icon="wap-home-o">首页</van-tabbar-item>
  19. <van-tabbar-item icon="description">文章</van-tabbar-item>
  20. <van-tabbar-item icon="user-circle-o">我的</van-tabbar-item>
  21. </van-tabbar>
  22. {/block}
  23. {block name="script"}
  24. <script>
  25. function v_setup() {
  26. let base = {};
  27. base.active = Vue.ref(0);
  28. base.onBack = () => {
  29. alert(1);
  30. }
  31. base.onTab = (index) => {
  32. alert(index)
  33. }
  34. return base;
  35. }
  36. </script>
  37. {/block}