UNPKG

skeleton-ui

Version:

skeleton project of vue at the core of JavaScript function

213 lines (197 loc) 8.28 kB
(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); }(function () { 'use strict'; // // // // // // // // var script = { name: 'skeleton-card', data: function data() { return {}; } }; function normalizeComponent(compiledTemplate, injectStyle, defaultExport, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, isShadowMode, createInjector, createInjectorSSR, createInjectorShadow) { if (typeof isShadowMode === 'function') { createInjectorSSR = createInjector; createInjector = isShadowMode; isShadowMode = false; } // Vue.extend constructor export interop var options = typeof defaultExport === 'function' ? defaultExport.options : defaultExport; // render functions if (compiledTemplate && compiledTemplate.render) { options.render = compiledTemplate.render; options.staticRenderFns = compiledTemplate.staticRenderFns; options._compiled = true; // functional template if (isFunctionalTemplate) { options.functional = true; } } // scopedId if (scopeId) { options._scopeId = scopeId; } var hook; if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__; } // inject component styles if (injectStyle) { injectStyle.call(this, createInjectorSSR(context)); } // register component module identifier for async chunk inference if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier); } }; // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook; } else if (injectStyle) { hook = isShadowMode ? function () { injectStyle.call(this, createInjectorShadow(this.$root.$options.shadowRoot)); } : function (context) { injectStyle.call(this, createInjector(context)); }; } if (hook) { if (options.functional) { // register for functional component in vue file var originalRender = options.render; options.render = function renderWithStyleInjection(h, context) { hook.call(context); return originalRender(h, context); }; } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate; options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; } } return defaultExport; } var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); function createInjector(context) { return function (id, style) { return addStyle(id, style); }; } var HEAD = document.head || document.getElementsByTagName('head')[0]; var styles = {}; function addStyle(id, css) { var group = isOldIE ? css.media || 'default' : id; var style = styles[group] || (styles[group] = { ids: new Set(), styles: [] }); if (!style.ids.has(id)) { style.ids.add(id); var code = css.source; if (css.map) { // https://developer.chrome.com/devtools/docs/javascript-debugging // this makes source maps inside style tags work properly in Chrome code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875 code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */'; } if (!style.element) { style.element = document.createElement('style'); style.element.type = 'text/css'; if (css.media) { style.element.setAttribute('media', css.media); } HEAD.appendChild(style.element); } if ('styleSheet' in style.element) { style.styles.push(code); style.element.styleSheet.cssText = style.styles .filter(Boolean) .join('\n'); } else { var index = style.ids.size - 1; var textNode = document.createTextNode(code); var nodes = style.element.childNodes; if (nodes[index]) { style.element.removeChild(nodes[index]); } if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); } else { style.element.appendChild(textNode); } } } } /* script */ var __vue_script__ = script; // For security concerns, we use only base name in production mode. See https://github.com/vuejs/rollup-plugin-vue/issues/258 script.__file = "C:\\Users\\Zhi\\Coding\\learn - github\\skeleton\\components\\card\\index.vue"; /* template */ var __vue_render__ = function() { var _vm = this; var _h = _vm.$createElement; var _c = _vm._self._c || _h; return _c("section", { staticClass: "skeleton-card" }, [ _c("div", [_vm._t("default")], 2) ]) }; var __vue_staticRenderFns__ = []; __vue_render__._withStripped = true; /* style */ var __vue_inject_styles__ = function (inject) { if (!inject) { return } inject("data-v-505292fe_0", { source: "\n.skeleton-card[data-v-505292fe] {\r\n box-shadow: 0px 10px 10px #f5f5f5;\r\n border-radius: 2px;\r\n background: #ffffff;\n}\r\n", map: {"version":3,"sources":["C:\\Users\\Zhi\\Coding\\learn - github\\skeleton/C:\\Users\\Zhi\\Coding\\learn - github\\skeleton\\components\\card\\index.vue"],"names":[],"mappings":";AAmBA;EACA,iCAAA;EACA,kBAAA;EACA,mBAAA;AACA","file":"index.vue","sourcesContent":["<template>\r\n <section class=\"skeleton-card\">\r\n <div>\r\n <slot></slot>\r\n </div>\r\n </section>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: 'skeleton-card',\r\n\r\n data() {\r\n return {};\r\n },\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n.skeleton-card {\r\n box-shadow: 0px 10px 10px #f5f5f5;\r\n border-radius: 2px;\r\n background: #ffffff;\r\n}\r\n</style>\r\n"]}, media: undefined }); }; /* scoped */ var __vue_scope_id__ = "data-v-505292fe"; /* module identifier */ var __vue_module_identifier__ = undefined; /* functional template */ var __vue_is_functional_template__ = false; /* style inject SSR */ var SkeletonCard = normalizeComponent( { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, createInjector, undefined ); var install = function install(Vue) { console.log('===================================='); console.log(SkeletonCard.name); console.log('===================================='); Vue.component(SkeletonCard.name, SkeletonCard); }; console.log('===================================='); console.log(SkeletonCard.name); console.log('===================================='); /* istanbul ignore if */ if (typeof window !== 'undefined' && window.Vue) { install(window.Vue); } module.exports = { install: install, SkeletonCard: SkeletonCard }; module.exports.default = module.exports; }));