UNPKG
antd-mobile-alita
Version:
latest (2.3.4)
2.3.4
基于 React 的移动设计规范实现
mobile.ant.design
ant-design/ant-design-mobile
antd-mobile-alita
/
es
/
_util
/
getDataAttr.js
8 lines
•
271 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
export
default
(
function
(
props
) {
return
Object
.
keys
(props).
reduce
(
function
(
prev, key
) {
if
(key.
substr
(
0
,
5
) ===
'aria-'
|| key.
substr
(
0
,
5
) ===
'data-'
|| key ===
'role'
) { prev[key] = props[key]; }
return
prev; }, {}); });