src/components/filePreview/index.vue
@@ -88,7 +88,6 @@ }); const isPdf = computed(() => { console.log(fileUrl.value) return /\.pdf$/i.test(fileUrl.value); }); @@ -167,6 +166,11 @@ fileUrl.value = window.location.protocol+'//'+window.location.host+ url; dialogVisible.value = true; }; const openUrl = (url) => { fileUrl.value = url; dialogVisible.value = true; } const handleClose = () => { dialogVisible.value = false; }; @@ -183,7 +187,8 @@ // 暴露open方法供外部调用 defineExpose({ open open, openUrl }) </script>