nav-button.vue 802 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <view>
  3. <page-head :title="title"></page-head>
  4. <view class="uni-padding-wrap uni-common-mt">
  5. <view class="uni-title">
  6. <uni-icons size="16" type="info"></uni-icons>说明 : </view>
  7. <view class="uni-helllo-text">
  8. <view>在App端可在pages.json里配置buttons,暂不支持动态改变buttons的样式,使用onNavigationBarButtonTap可监听buttons的点击事件。</view>
  9. <view>在小程序端,不支持配置buttons,故按钮不见了。</view>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. title: 'nav-button'
  19. }
  20. },
  21. onNavigationBarButtonTap(e) {
  22. uni.showToast({
  23. title: e.index === 0 ? "你点了分享按钮" : "你点了收藏按钮",
  24. icon: "none"
  25. })
  26. }
  27. }
  28. </script>
  29. <style>
  30. </style>