File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1515 :show-upload-button =" readonly ? false : option.showUploadButton"
1616 :disabled =" option.disabled"
1717 :class =" {
18+ 'crco-upload-disabled-preview': option.disabledPreview || false,
1819 'crco-upload-readonly': readonly || option.readonly,
1920 'crco-upload-large': option.large
2021 }"
@@ -314,8 +315,15 @@ const handleDownloadFile = () => {
314315 window .open (clickFile .value .originUrl )
315316}
316317const preview = (file : any ) => {
318+ if (props .option .disabledPreview ) {
319+ return
320+ }
317321 if (props .option .listType !== ' picture' && props .option .listType !== ' picture-card' ) {
318322 const url = file .response && file .response .url ? file .response .url : file .url
323+ if (! url ) {
324+ console .warn (' Not fount url' , file )
325+ return
326+ }
319327 if (! isImg (url )) {
320328 if (! isPdf (url ) && ! isOffice (url ) && ! isTxt (url )) {
321329 window .open (url )
@@ -430,6 +438,11 @@ const download = (url: string) => {
430438 white-space : normal ;
431439 cursor : pointer ;
432440}
441+ .crco-upload-disabled-preview {
442+ ::v-deep (.arco-upload-list-item-name-text ) {
443+ cursor : unset ;
444+ }
445+ }
433446.crco-upload-readonly {
434447 ::v-deep (.arco-upload-list-picture ) {
435448 width : 40px ;
Original file line number Diff line number Diff line change @@ -205,4 +205,10 @@ export type UploadType = {
205205 * @default false
206206 */
207207 large ?: boolean
208+
209+ /**
210+ * @zh 是否禁用点击预览,默认false
211+ * @default false
212+ */
213+ disabledPreview ?: boolean
208214}
You can’t perform that action at this time.
0 commit comments