mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-11-29 18:57:36 +08:00
Types: complete method declarations in the documentation (#10233)
* Chore: complete the method declarations specified in the document * Fix: fix a misspell mistake
This commit is contained in:
parent
441669f081
commit
d0809e4915
6
types/menu.d.ts
vendored
6
types/menu.d.ts
vendored
@ -37,4 +37,10 @@ export declare class ElMenu extends ElementUIComponent {
|
||||
|
||||
/** Whether the menu collapse transition is active */
|
||||
collapseTransition: boolean
|
||||
|
||||
/** Open the specified sub-menu */
|
||||
open (index: string): void
|
||||
|
||||
/** Close the specified sub-menu */
|
||||
close (index: string): void
|
||||
}
|
||||
|
17
types/table.d.ts
vendored
17
types/table.d.ts
vendored
@ -99,4 +99,21 @@ export declare class ElTable extends ElementUIComponent {
|
||||
* @param row The row that is going to set as selected
|
||||
*/
|
||||
setCurrentRow (row?: object): void
|
||||
|
||||
/**
|
||||
* Toggle or set if a certain row is expanded
|
||||
*
|
||||
* @param row The row that is going to set its expanded state
|
||||
* @param expanded Whether the row is expanded. The expanded state will be toggled if not set
|
||||
*/
|
||||
toggleRowExpansion (row: object, expanded?: boolean): void
|
||||
|
||||
/** Clear sort status, reset the table to unsorted */
|
||||
clearSort (): void
|
||||
|
||||
/** Clear filter, reset the table to unfiltered */
|
||||
clearFilter (): void
|
||||
|
||||
/** Relayout the table, maybe needed when change the table or it's ancestors visibility */
|
||||
doLayout (): void
|
||||
}
|
||||
|
5
types/transfer.d.ts
vendored
5
types/transfer.d.ts
vendored
@ -1,6 +1,8 @@
|
||||
import { CreateElement, VNode } from 'vue'
|
||||
import { ElementUIComponent } from './component'
|
||||
|
||||
export type TransferPanelPosition = 'left' | 'right'
|
||||
|
||||
export interface TransferData {
|
||||
key: any,
|
||||
label: string,
|
||||
@ -65,4 +67,7 @@ export declare class ElTransfer extends ElementUIComponent {
|
||||
|
||||
/** Key array of initially checked data items of the right list */
|
||||
rightDefaultChecked: any[]
|
||||
|
||||
/** Clear the query text in specified panel */
|
||||
clearQuery (which: TransferPanelPosition): void
|
||||
}
|
||||
|
58
types/tree.d.ts
vendored
58
types/tree.d.ts
vendored
@ -84,12 +84,20 @@ export declare class ElTree extends ElementUIComponent {
|
||||
indent: number
|
||||
|
||||
/**
|
||||
* Filter all tree nodes.Ffiltered nodes will be hidden
|
||||
* Filter all tree nodes. Filtered nodes will be hidden
|
||||
*
|
||||
* @param value The value to be used as first parameter for `filter-node-method`
|
||||
*/
|
||||
filter (value: any): void
|
||||
|
||||
/**
|
||||
* Update the children of the node which specified by the key
|
||||
*
|
||||
* @param key the key of the node which children will be updated
|
||||
* @param data the children data
|
||||
*/
|
||||
updateKeyChildren (key: any, data: TreeNode[]): void
|
||||
|
||||
/**
|
||||
* If the node can be selected (`show-checkbox` is `true`), it returns the currently selected array of nodes
|
||||
*
|
||||
@ -129,6 +137,16 @@ export declare class ElTree extends ElementUIComponent {
|
||||
*/
|
||||
setChecked (data: TreeNode | any, checked: boolean, deep: boolean): void
|
||||
|
||||
/**
|
||||
* If the node can be selected (`show-checkbox` is `true`), it returns the currently half selected array of nodes
|
||||
*/
|
||||
getHalfCheckedNodes (): void
|
||||
|
||||
/**
|
||||
* If the node can be selected (`show-checkbox` is `true`), it returns the currently half selected array of nodes' keys
|
||||
*/
|
||||
getHalfCheckedKeys (): void;
|
||||
|
||||
/**
|
||||
* Return the highlight node's key (null if no node is highlighted)
|
||||
*/
|
||||
@ -152,4 +170,42 @@ export declare class ElTree extends ElementUIComponent {
|
||||
* @param node The node to be highlighted
|
||||
*/
|
||||
setCurrentNode (node: TreeNode): void
|
||||
|
||||
/**
|
||||
* Get node by node key or node data
|
||||
*
|
||||
* @param by node key or node data
|
||||
*/
|
||||
getNode (by: TreeNode | any): TreeNode
|
||||
|
||||
/**
|
||||
* Remove node by key or node data or node instance
|
||||
*
|
||||
* @param by key or node data or node instance
|
||||
*/
|
||||
remove (by: TreeNode | any): void
|
||||
|
||||
/**
|
||||
* Append a child node to specified node
|
||||
*
|
||||
* @param childData the data of appended node
|
||||
* @param parent key or node data or node instance of the parent node
|
||||
*/
|
||||
append (childData: TreeNode, parent: TreeNode | any): void
|
||||
|
||||
/**
|
||||
* insert a node before specified node
|
||||
*
|
||||
* @param data the data of inserted node
|
||||
* @param ref key or node data or node instance of the reference node
|
||||
*/
|
||||
insertBefore (data: TreeNode, ref: TreeNode | any): void
|
||||
|
||||
/**
|
||||
* insert a node after specified node
|
||||
*
|
||||
* @param data the data of inserted node
|
||||
* @param ref key or node data or node instance of the reference node
|
||||
*/
|
||||
insertAfter (data: TreeNode, ref: TreeNode | any): void
|
||||
}
|
||||
|
6
types/upload.d.ts
vendored
6
types/upload.d.ts
vendored
@ -108,4 +108,10 @@ export declare class ElUpload extends ElementUIComponent {
|
||||
|
||||
/** Hook function when limit is exceeded */
|
||||
onExceed: (file: ElUploadInternalFileDetail, fileList: ElUploadInternalFileDetail[]) => void
|
||||
|
||||
/** Clear the upload file list */
|
||||
clearFiles (): void;
|
||||
|
||||
/** Abort specified file */
|
||||
abort (file: ElUploadInternalFileDetail): void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user