vant-weapp/dist/utils/index.js
2017-12-10 00:17:38 +08:00

11 lines
268 B
JavaScript

// 从事件对象中解析得到 componentId
// 需要在元素上声明 data-component-id
function extractComponentId(event = {}) {
const { dataset: { componentId } } = event.currentTarget || {};
return componentId;
}
module.exports = {
extractComponentId
};