view-code-page.vue 919 字节
Newer Older
1 2 3 4 5 6 7 8 9
<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'
10
  import uniIm from '@/uni_modules/uni-im/sdk/index.js';
11 12 13 14 15 16 17 18 19 20 21 22 23
  export default {
    components: {
      uniImCodeView
    },
    data() {
      return {
        msg: {
          type: "code",
          body: ""
        }
      }
    },
    onLoad({
24
      msgId,conversationId
25
    }) {
26 27 28
      this.msg = uniIm.conversation.dataList
          .find(item => item.id === conversationId)
          .msgList.find(item => item._id === msgId)
29 30 31 32 33 34
    },
    methods: {}
  }
</script>

<style lang="scss">
35
@import "@/uni_modules/uni-im/common/baseStyle.scss";
36 37 38 39 40 41
.text-box,
.code-view {
  width: 750rpx;
  height: 100vh;
}
</style>