avm-zy-attach-preview

介绍

附件预览组件,支持大多数格式(注意仅支持可http或https网络路径附件预览)

使用方式

import "../../components/avm-zy-attach-preview/avm-zy-attach-preview.stml";

代码示例

<view v-if="showzyPreview" class="preview_box">
    <avm-zy-attach-preview name="preview" :url="previewUrl" @event="zyPreviewEvent"></avm-zy-attach-preview>
</view>

API

props 属性

参数 说明 类型 默认
name 唯一自定义frame的name 可同时存在多个 String
url 传入当前需要预览的附件网络路径 String

Events事件

事件名称 说明 回调参数
event 打开预览失败事件 {"type":"close"}

案例

<view v-if="showzyPreview" class="preview_box">
    <avm-zy-attach-preview name="preview" :url="previewUrl" @event="zyPreviewEvent"></avm-zy-attach-preview>
</view>
<script>
import "../../components/avm-zy-search/avm-zy-search.stml";
export default {
    name: "tpl",
    apiready() {
        api.setStatusBarStyle({ style: "light", color: "-" });
        api.removeLaunchView();
    },
    watch:{
    },
    data() {
        return {
            previewUrl:"https://xxx/preview.docx",
            showzyPreview:false,
        };
    },
    computed: {

    },
    methods: {
        zyPreviewEvent(e){
            this.showzyPreview = false;
        },
        openPreview(){
            this.showzyPreview = !this.showzyPreview;
        },
    }
};
</script>

帮助说明/联系方式

如需修改或修改样式请查看components下对应的stml,如需要更多自定义功能或反馈与BUG,可联系QQ:1161277121

是否仍需要帮助? 请保持联络!
最后更新于 2024/04/24