vue.cjs.min.js 1.3 KB

12
  1. "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var compilerDom=require("@vue/compiler-dom"),runtimeDom=require("@vue/runtime-dom"),shared=require("@vue/shared");function _interopNamespace(r){if(r&&r.__esModule)return r;var o=Object.create(null);return r&&Object.keys(r).forEach(function(e){o[e]=r[e]}),o.default=r,Object.freeze(o)}var runtimeDom__namespace=_interopNamespace(runtimeDom);const compileCache=Object.create(null);function compileToFunction(o,e){if(!shared.isString(o)){if(!o.nodeType)return runtimeDom.warn("invalid template option: ",o),shared.NOOP;o=o.innerHTML}var r=o,t=compileCache[r];if(t)return t;"#"===o[0]&&((t=document.querySelector(o))||runtimeDom.warn("Template element not found or is empty: "+o),o=t?t.innerHTML:"");t=compilerDom.compile(o,shared.extend({hoistStatic:!0,onError:n,onWarn:e=>n(e,!0)},e)).code;function n(e,r=!1){r=r?e.message:"Template compilation error: "+e.message,e=e.loc&&shared.generateCodeFrame(o,e.loc.start.offset,e.loc.end.offset);runtimeDom.warn(e?r+`
  2. `+e:r)}const i=new Function("Vue",t)(runtimeDom__namespace);return i._rc=!0,compileCache[r]=i}runtimeDom.registerRuntimeCompiler(compileToFunction),Object.keys(runtimeDom).forEach(function(e){"default"!==e&&(exports[e]=runtimeDom[e])}),exports.compile=compileToFunction;