Skip to content

Commit

Permalink
更新 asList 的文档
Browse files Browse the repository at this point in the history
  • Loading branch information
lip8up committed Feb 18, 2022
1 parent 46090f8 commit d63f280
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ __toString() | 无法被主动调用,在对实例本身进行字符串连接
方法名 | 说明
--- | ---
allConstants() | 获取全部常量列表,格式:`[ key1 => [value1, label1], ... ]`,例如:`[ 'One' => [1, '一'], 'Two' => [2, '二'], 'Three' => [3, '三'] ]`
asList() | 作为列表返回,以便前端使用,返回值用类 js 格式表示:`[ { key: key1, value: value1, label: label1 }, ... ]`
allKeys() | 获取全部 key 列表。
allValues() | 获取全部 value 列表。
allLabels() | 获取全部 label 列表。
Expand Down
2 changes: 1 addition & 1 deletion src/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static function allConstants(): array
}

/**
* 作为列表返回,以便前端使用, js 格式:`[ { key: key1, value: value1, label: label1 }, ... ]`。
* 作为列表返回,以便前端使用,返回值用类 js 格式表示:`[ { key: key1, value: value1, label: label1 }, ... ]`。
*
* @return array
*
Expand Down

0 comments on commit d63f280

Please sign in to comment.