view-code-page.nvue 855 字节
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<template>
  <view class="code-view">
    <!-- 默认不启用代码浏览模块,如有需要请关闭注释 -->
    <uni-im-code-view :msg="msg" :showFullBtn="false"></uni-im-code-view>
  </view>
</template>

<script>
  import uniImCodeView from '@/uni_modules/uni-im/components/uni-im-msg/types/code.vue'
  export default {
    components: {
      uniImCodeView
    },
    data() {
      return {
        msg: {
          type: "code",
          body: ""
        }
      }
    },
    onLoad({
      code
    }) {
      console.log(code)

      this.msg.body = JSON.parse(decodeURIComponent(code));
    },
    methods: {}
  }
</script>

<style lang="scss">
  .text-box,
  .code-view {
    flex: 1;
    width: 750rpx;
    /* #ifndef APP-NVUE */
    width: 100vw;
    height: 100vh;
    /* #endif */
  }
</style>