UNPKG

@appscode/vue-ssr

Version:

A vue component to preserve server side rendered html

1 lines 1.62 kB
var VueSsr=function(e){"use strict";var n=function(e,n,t,i,o,r,s,d,a,u){"boolean"!=typeof s&&(a=d,d=s,s=!1);const l="function"==typeof t?t.options:t;let c;if(e&&e.render&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,o&&(l.functional=!0)),i&&(l._scopeId=i),r?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},l._ssrRegister=c):n&&(c=s?function(e){n.call(this,u(e,this.$root.$options.shadowRoot))}:function(e){n.call(this,d(e))}),c)if(l.functional){const e=l.render;l.render=function(n,t){return c.call(t),e(n,t)}}else{const e=l.beforeCreate;l.beforeCreate=e?[].concat(e,c):[c]}return t}({render:function(){var e=this.$createElement;return(this._self._c||e)("transition",this._g(this._b({attrs:{name:"appscode-vue-ssr-wrapper"}},"transition",this.$attrs,!1),this.$listeners),[this._t("default")],2)},staticRenderFns:[]},void 0,{name:"Ssr",props:{eid:{type:String,default:""}},data:function(){return{innerHTML:""}},beforeMount:function(){var e=document.getElementById(this.eid);this.innerHTML=e&&e.innerHTML},mounted:function(){var e=document.getElementById(this.eid);e&&this.innerHTML&&(e.innerHTML=this.innerHTML)}},void 0,!1,void 0,!1,void 0,void 0,void 0),t=function(e){t.installed||(t.installed=!0,e.component("VueSsr",n))},i={install:t},o=null;return"undefined"!=typeof window?o=window.Vue:"undefined"!=typeof global&&(o=global.Vue),o&&o.use(i),n.install=t,e.default=n,e}({});