-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(upload): add abstract
prop, separate upload-file-list
and upload-trigger
components
#1193
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1233d8a
feat(upload): add `abstract` prop, separate `upload-file-list` and `…
1ab4530
docs(upload): add `abstract` props docs and CHANGELOG (#1102)
91d822b
Merge branch 'main' into feature/upload
f8fe3b3
feat(upload): add upload tests (#1102)
02a49b9
feat(upload): fix `upload-trigger` and `upload-file-list` bug (#1102)
6d68daf
docs(upload): remove `upload-trigger` abstract prop (#1102)
dd65b12
Merge branch 'main' into feature/upload
07akioni ae0761a
feat(upload) fix upload-file-list method (#1102)
cac57c4
feat(upload): fix lint (#1102)
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# No Wrapper DOM | ||
|
||
`n-upload` set `abstract`. | ||
|
||
`n-upload-trigger` and `n-upload-file-list` need to be called from within `n-upload`. | ||
|
||
```html | ||
<div> | ||
<n-upload | ||
abstract | ||
:default-file-list="fileList" | ||
action="http://www.mocky.io/v2/5e4bafc63100007100d8b70f" | ||
> | ||
<n-button-group> | ||
<n-button> Eat </n-button> | ||
<n-button> Sleep </n-button> | ||
<n-upload-trigger #="{handleClick}"> | ||
<n-button @click="handleClick">Upload</n-button> | ||
</n-upload-trigger> | ||
</n-button-group> | ||
|
||
<n-card style="margin-top: 12px;" title="File List"> | ||
<n-upload-file-list /> | ||
</n-card> | ||
</n-upload> | ||
</div> | ||
``` | ||
|
||
```js | ||
import { defineComponent, ref } from 'vue' | ||
export default defineComponent({ | ||
setup () { | ||
const fileListRef = ref([ | ||
{ | ||
id: 'b', | ||
name: 'file.doc', | ||
status: 'finished', | ||
type: 'text/plain' | ||
} | ||
]) | ||
|
||
return { fileList: fileListRef } | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 不需要包裹 DOM | ||
|
||
`n-upload` 设置 `abstract`。 | ||
|
||
`n-upload-trigger`和 `n-upload-file-list` 需在 `n-upload` 内调用。 | ||
|
||
```html | ||
<div> | ||
<n-upload | ||
abstract | ||
:default-file-list="fileList" | ||
action="http://www.mocky.io/v2/5e4bafc63100007100d8b70f" | ||
> | ||
<n-button-group> | ||
<n-button> Eat </n-button> | ||
<n-button> Sleep </n-button> | ||
<n-upload-trigger #="{handleClick}"> | ||
<n-button @click="handleClick">Upload</n-button> | ||
</n-upload-trigger> | ||
</n-button-group> | ||
|
||
<n-card style="margin-top: 12px;" title="File List"> | ||
<n-upload-file-list /> | ||
</n-card> | ||
</n-upload> | ||
</div> | ||
``` | ||
|
||
```js | ||
import { defineComponent, ref } from 'vue' | ||
export default defineComponent({ | ||
setup () { | ||
const fileListRef = ref([ | ||
{ | ||
id: 'b', | ||
name: 'file.doc', | ||
status: 'finished', | ||
type: 'text/plain' | ||
} | ||
]) | ||
|
||
return { fileList: fileListRef } | ||
} | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export { default as NUpload } from './src/Upload' | ||
export { default as NUploadDragger } from './src/UploadDragger' | ||
export { default as NUploadTrigger } from './src/UploadTrigger' | ||
export { default as NUploadFileList } from './src/UploadFileList' | ||
export type { UploadProps } from './src/Upload' | ||
export type { uploadDraggerKey } from './src/UploadDragger' | ||
export type { UploadInst, FileInfo as UploadFileInfo } from './src/interface' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不算 breaking change,因为用户已经写好的代码不会崩