forked from tusen-ai/naive-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(upload): add
abstract
props docs and CHANGELOG (tusen-ai#1102)
- Loading branch information
kev1nzh
committed
Sep 17, 2021
1 parent
1233d8a
commit 1ab4530
Showing
6 changed files
with
126 additions
and
0 deletions.
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` and `n-upload-trigger` 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 abstract #="{handleTriggerClick}"> | ||
<n-button @click="handleTriggerClick">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` 和 `n-upload-trigger` 设置 `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 abstract #="{handleTriggerClick}"> | ||
<n-button @click="handleTriggerClick">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