code-info.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <view>
  3. <template v-if="navKey">
  4. <navbar key='navKey' ref="navbar" :config="config" backColor="#333333"></navbar>
  5. </template>
  6. <view class="content-box">
  7. {{remark}}
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. config: {
  16. back: true, //false是tolbar页面 是则不写
  17. title: '',
  18. color: '#1A1A1A',
  19. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  20. backgroundColor: [1, 'transparent'],
  21. },
  22. navKey:'',
  23. remark:''
  24. };
  25. },
  26. onLoad(options) {
  27. const eventChannel = this.getOpenerEventChannel();
  28. // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  29. eventChannel.on('CodeInfo', res => {
  30. const data = res.data;
  31. this.config.title = data.name;
  32. this.navKey = Math.random()
  33. this.remark = data.remark;
  34. this.$forceUpdate()
  35. })
  36. },
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .content-box{
  41. width: 100%;
  42. padding: 30rpx;
  43. text-indent: 2em;
  44. font-size: 32rpx;
  45. color: #585859;
  46. }
  47. </style>