MCPcopy
hub / github.com/keepfool/vue-tutorials / query

Function query

06.Router/basic/js/vue.js:1124–1133  ·  view source on GitHub ↗

* Query an element selector if it's not an element already. * * @param {String|Element} el * @return {Element}

(el)

Source from the content-addressed store, hash-verified

1122 */
1123
1124 function query(el) {
1125 if (typeof el === 'string') {
1126 var selector = el;
1127 el = document.querySelector(el);
1128 if (!el) {
1129 'development' !== 'production' && warn('Cannot find element: ' + selector);
1130 }
1131 }
1132 return el;
1133 }
1134
1135 /**
1136 * Check if a node is in the document.

Callers 4

stateMixinFunction · 0.70
domAPIFunction · 0.70
insertFunction · 0.70
lifecycleAPIFunction · 0.70

Calls 1

warnFunction · 0.70

Tested by

no test coverage detected