# FilePreview 文件预览(齐思博)

# 基础用法

同时支持文件下载及预览。

文件下载:
文件下载2:

需要设置name属性和url属性,接收String,目前文件预览只支持word,ppt,excel。如果非上面几种类型文件则不展示预览

<template>
  <div>
    文件下载: <h-file-preview :name="name" :url="url"></h-file-preview>
    <br />
    文件下载2: <h-file-preview :name="name" :url="url" :size="'mini'"></h-file-preview>
  </div>
</template>
<script>
export default {
  data() {
    return {
      name: '文件11',
      url: 'https://ys-internal-resource.haigeek.com/ossresource/selfService/hardware/devicemappingexcel/设备模型与六位码对应关系表-商用干衣机-111c120024000810050101818000180000000000000000000000000000000000-3102-20221118180410663.xlsx'
    }
  }
}
</script>
显示代码

# Attributes

参数 说明 类型 可选值 默认值
name 文件名称 string
downname 下载文件的名称 string 如果不传默认使用name作为下载文件名
url 文件地址(预览仅支持word,ppt,excel) string
size 尺寸 string normal / mini normal