(props, events, ...args)
| 106 | } |
| 107 | |
| 108 | export function emit(props, events, ...args) { |
| 109 | if (!events || !events.trim().length || typeof events !== 'string') return; |
| 110 | |
| 111 | events |
| 112 | .trim() |
| 113 | .split(' ') |
| 114 | .forEach((event) => { |
| 115 | let eventName = (event || '').trim(); |
| 116 | if (!eventName) return; |
| 117 | eventName = eventName.charAt(0).toUpperCase() + eventName.slice(1); |
| 118 | |
| 119 | const propName = `on${eventName}`; |
| 120 | |
| 121 | if (props[propName]) props[propName](...args); |
| 122 | }); |
| 123 | } |
| 124 | |
| 125 | export function getExtraAttrs(props = {}) { |
| 126 | const extraAttrs = {}; |
no outgoing calls
no test coverage detected