MCPcopy Create free account
hub / github.com/TruthHun/BookStack / initAssetRegisters

Function initAssetRegisters

static/vuejs/vue.runtime.js:3977–4010  ·  view source on GitHub ↗
(Vue)

Source from the content-addressed store, hash-verified

3975/* */
3976
3977function initAssetRegisters (Vue) {
3978 /**
3979 * Create asset registration methods.
3980 */
3981 config._assetTypes.forEach(function (type) {
3982 Vue[type] = function (
3983 id,
3984 definition
3985 ) {
3986 if (!definition) {
3987 return this.options[type + 's'][id]
3988 } else {
3989 /* istanbul ignore if */
3990 {
3991 if (type === 'component' && config.isReservedTag(id)) {
3992 warn(
3993 'Do not use built-in or reserved HTML elements as component ' +
3994 'id: ' + id
3995 );
3996 }
3997 }
3998 if (type === 'component' && isPlainObject(definition)) {
3999 definition.name = definition.name || id;
4000 definition = this.options._base.extend(definition);
4001 }
4002 if (type === 'directive' && typeof definition === 'function') {
4003 definition = { bind: definition, update: definition };
4004 }
4005 this.options[type + 's'][id] = definition;
4006 return definition
4007 }
4008 };
4009 });
4010}
4011
4012/* */
4013

Callers 1

initGlobalAPIFunction · 0.70

Calls 3

extendMethod · 0.80
isPlainObjectFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected