* Query an element selector if it's not an element already.
(el)
| 4364 | * Query an element selector if it's not an element already. |
| 4365 | */ |
| 4366 | function query (el) { |
| 4367 | if (typeof el === 'string') { |
| 4368 | var selected = document.querySelector(el); |
| 4369 | if (!selected) { |
| 4370 | process.env.NODE_ENV !== 'production' && warn( |
| 4371 | 'Cannot find element: ' + el |
| 4372 | ); |
| 4373 | return document.createElement('div') |
| 4374 | } |
| 4375 | return selected |
| 4376 | } else { |
| 4377 | return el |
| 4378 | } |
| 4379 | } |
| 4380 | |
| 4381 | /* */ |
| 4382 |