routeTo.vue 804 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view class="u-demo">
  3. <view class="u-demo-wrap">
  4. <view class="u-demo-title">演示效果</view>
  5. <view class="u-demo-area">
  6. <view class="u-no-demo-here">
  7. 收到的参数为:{{paramsStr}}
  8. </view>
  9. <view class="u-btn-wrap">
  10. <u-button @click="back">返回</u-button>
  11. </view>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. params: {}
  21. }
  22. },
  23. onLoad(option) {
  24. this.params = option;
  25. },
  26. computed: {
  27. paramsStr() {
  28. return JSON.stringify(this.params);
  29. }
  30. },
  31. methods: {
  32. back() {
  33. this.$u.route({
  34. type: 'back',
  35. animationType: 'slide-in-top'
  36. });
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .wrap {
  43. padding: 24rpx;
  44. }
  45. .u-btn-wrap {
  46. margin-top: 50rpx;
  47. }
  48. </style>