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

Function initAssetRegisters

static/vuejs/vue.esm.js:3985–4018  ·  view source on GitHub ↗
(Vue)

Source from the content-addressed store, hash-verified

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

Callers 1

initGlobalAPIFunction · 0.70

Calls 3

extendMethod · 0.80
isPlainObjectFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected