diff --git a/govue/bindata.go b/govue/bindata.go index 16a34b7..c92f08a 100644 --- a/govue/bindata.go +++ b/govue/bindata.go @@ -132,7 +132,7 @@ func govueRuntimePolyfillJs() (*asset, error) { return a, nil } -var _govueRuntimeRuntimeJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x55\x51\x6f\xe2\x38\x10\x7e\xaf\xd4\xff\x30\x8d\x4e\xc2\x51\x49\x2a\x9d\x4e\xf7\x40\x9b\x3e\x1c\x57\x71\xad\x74\x77\x12\xb4\xbc\x5c\x4f\x2b\x6f\x18\xc0\xbb\xc6\x4e\x6d\x87\x82\x2a\xfe\xfb\xca\x26\x81\xd8\x09\xdb\xee\xe6\x05\xe2\x99\xf9\xe6\x9b\x99\x6f\x9c\xd1\x34\x65\x82\x19\x32\x2f\x45\x6e\x98\x14\x40\x3e\x29\x7c\x29\x99\xc2\x18\xde\xce\xcf\x00\x00\x04\xbe\x42\xc3\x7e\x38\xb7\x8f\x59\x32\x9d\x56\x01\x90\x41\x1d\x7b\x7d\xf4\x58\x53\x05\xd3\xd2\x1a\x9d\xef\xfe\x6f\xed\x47\x7a\xd3\x12\x7b\xf1\xf5\xf9\x59\x00\x39\x2d\x71\x2c\x4b\x83\xca\x73\x5e\x97\x98\x28\x77\xec\x62\xc2\x88\xb4\xd4\x48\xfc\xf0\x96\x1b\xdd\x30\xa9\x3d\x50\x77\xe2\xe1\x59\xca\x4b\xb3\xe2\x05\x55\x1a\xd5\xaf\x9e\x77\xe3\xdc\x8b\x71\x28\x4f\x55\xfe\x56\xd6\x17\x3f\xe5\x8b\x6e\xf3\x1f\xc9\x69\x89\x7f\xcb\x52\x18\xc8\xe0\xd8\x6d\x5a\x14\x7d\xc8\xa5\x30\xb8\x31\x5e\xe7\x6b\xa2\xb9\xd9\x40\x06\x23\x34\x0e\xe0\x11\x57\x05\xa7\x06\xc9\x48\xfe\x65\x56\x7c\xa2\xf2\x66\xa2\x43\x0c\x47\x2a\xee\x05\x67\x02\x1f\xf4\xb0\x13\xa0\xb6\x92\xdc\x6c\x52\x53\x1d\xfa\x83\x72\x65\x17\x45\xfa\x8b\x2c\x2c\x57\x7d\x70\x83\xcc\xb2\x4a\x1d\x6b\x61\x5a\x31\x57\x57\xb6\x20\x2d\x39\xa6\x5c\x2e\xfc\x04\x6d\xae\x0a\xc5\x0c\x55\x87\x10\x34\xaa\x35\xaa\xa4\xb6\xf7\xe2\x34\x57\x48\x0d\x8e\xab\x03\x12\x34\xcb\x75\xba\xca\x33\x68\xb5\xe0\x40\xc1\x0f\xda\xb5\x4b\x66\x73\x20\x17\xa7\x26\x62\x9f\xca\x06\x19\xbc\xed\x02\x34\xff\xb5\x72\x4c\xbd\xc6\x43\x06\xd1\xcd\x42\x26\xb6\xc4\x43\x43\xb5\xd9\x72\xcc\x7a\x33\xa6\x0b\x4e\xb7\x03\x10\x52\x60\xef\x36\x82\x4b\xf8\x83\x6a\xfc\xfd\xb7\x3b\x91\xcb\x19\x12\x74\x3f\x4f\xe3\xfb\xa1\x5c\x15\x52\xa0\x30\xa4\x31\x88\x38\x86\x4b\x88\x6e\xae\x02\xf0\xdb\xe8\x3b\xac\xfe\xa4\x86\x36\x19\xcd\xec\xfb\xcf\xb3\x79\x98\xfc\xfb\x4f\xaa\x8d\x62\x62\xc1\xe6\x5b\xe2\xd4\x63\x21\xe3\x80\x9b\x3d\x0b\x79\xd5\x83\x4e\xf7\x7f\x1e\xe5\xc4\xe1\x78\x1b\xd2\x6f\x6c\x0e\x2a\xd5\x77\x6b\xdc\x39\x24\x3b\x45\x54\xaa\xd3\x66\x1f\x7b\x9d\x54\xba\x76\x83\xbc\xee\x76\x33\x4b\x25\x5f\x01\x95\x6a\x9b\x77\x80\x5c\xe3\x29\x7c\x4b\x0c\x32\xf7\x93\x2a\x2c\x38\xcd\x91\x44\x37\x17\x49\xb2\x58\x27\x5f\x74\x22\x4b\xc3\xd1\x24\xc9\x6d\xd4\x6f\x29\xb5\x1e\xe7\x09\x4a\x23\x39\x46\x53\x2a\x41\x5c\xed\x1d\x4e\xa1\x28\x1b\x4b\xb7\xb3\x62\x6f\x5c\x4c\x6a\x1b\xf2\xc7\x35\xe5\x64\x24\x9f\x34\x0e\x29\xe7\x9f\x69\xfe\xb5\x19\x0e\x39\x35\xf9\x12\x08\xb6\xfa\x3a\x92\x13\x34\x77\x4a\x49\x15\x8a\xa0\x73\x83\x66\x38\x00\x2f\x4b\xbf\xed\x85\x16\x6d\x00\x98\x9a\x5a\x0a\x71\x3f\x2c\x2d\xac\xff\x9d\xb1\x56\xe3\x3c\xd9\x10\x77\x79\xca\x19\xea\xc6\x8d\xf9\xa0\x87\x56\xed\x8d\x0f\x43\x1f\x8e\xb7\xef\x31\x36\xb8\xf6\x82\x2e\x38\xd4\xb8\xe1\x3e\x97\x0a\x88\xcd\xc7\x80\x89\x7d\xd2\x56\x53\x03\xc8\xe8\x95\x99\xe5\xfe\x03\xf4\xf6\x2c\xec\x3e\xba\xb0\xff\xd8\xff\x76\xb9\x9e\xc5\x2e\x0a\xdb\xd1\x31\xe0\xc3\x90\x3f\x80\x16\x74\xfb\xf4\xf4\x7f\x58\x01\x70\x50\xc1\xfb\x34\x3a\xa4\x01\x1f\x92\x07\x74\x4a\x04\x3e\xb6\xfd\x2d\xa9\x80\xbf\x5a\xbb\xa6\x6e\x3a\xf0\xf6\xc6\x5d\x4c\xe2\xf3\x33\xbb\x82\xdf\x02\x00\x00\xff\xff\xd1\x46\x37\x31\x89\x09\x00\x00") +var _govueRuntimeRuntimeJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x56\x51\x6f\xea\x36\x14\x7e\xaf\xd4\xff\x70\x6e\x34\x09\x47\x97\xa4\xd2\x34\xed\x01\x4a\x1f\xc6\xae\x58\x2b\x6d\x93\xa0\xe5\xa5\xad\x26\x2f\x1c\xc0\x9b\xb1\x53\xdb\xa1\xa0\x2a\xff\x7d\xb2\x21\x10\x3b\x49\xdb\x5d\xbf\x24\x39\x3e\xe7\xf8\x3b\xfe\xbe\x63\x67\x32\x4f\x99\x60\x86\x2c\x0b\x91\x19\x26\x05\x90\xbf\x14\xbe\x14\x4c\x61\x0c\x6f\x97\x17\x00\x00\x02\x5f\xa1\x36\x7f\xb2\xdb\x61\xd6\x4c\xa7\xc7\x00\x18\x41\x15\x3b\x3c\x7b\x6c\xa9\x82\x79\x61\x27\x9d\xef\xe1\xb5\xf2\x23\xbd\x79\x81\xbd\x78\x78\x79\xe1\x07\x8c\x39\x52\x71\x70\xed\x58\xd8\x8e\xa5\x54\x40\xac\x3b\x03\x26\xec\x22\xa9\xcc\xad\xab\x4e\x33\xb9\xc9\xa5\x40\x61\x74\x1c\xc4\xd8\xb1\x40\x8e\x06\x3b\x02\x1e\xd9\xf3\xd0\x0f\x29\xcf\x9f\xa5\x43\x1a\x94\x3f\x2f\x70\x2a\x0b\x83\xca\x2b\x6c\x5b\x60\xa2\x9c\xd9\xd5\x17\x46\xa4\x85\x46\xe2\x87\x37\xdc\xe8\x8e\x49\xed\x25\x75\x16\x2f\x9f\x2d\x7f\x6d\x36\x3c\xa7\x4a\xa3\xfa\xd1\xf3\xae\xd9\xbd\x18\x97\xe5\xe1\xb8\x7e\x63\xd5\x17\x7f\xc9\x17\xdd\xc4\x3f\x91\xf3\x02\x7f\x97\x85\x30\x1e\x41\x34\xcf\xfb\x90\x49\x61\x70\x67\x1a\x64\x59\xa0\x99\xd9\xc1\x08\x26\x68\x5c\x82\x7b\xdc\xe4\x9c\x1a\x24\x13\xf9\x9b\xd9\xf0\x99\xca\xe2\x61\x4b\x8c\x95\xc2\xad\xe0\x4c\xe0\x9d\x1e\xb7\x26\xa8\x66\x49\x66\x76\xa9\x39\x1a\x7d\x51\xb9\xb2\xf3\x3c\xfd\xa1\x22\xbc\x72\x83\x91\x45\x95\x3a\xd4\xc2\x34\x62\x2c\x82\xc0\xb5\xfa\x0c\xb0\xb2\x25\x90\x10\x6b\x9b\xf8\xea\xd9\x02\xf7\xae\xd4\x65\x1b\x2a\x85\x62\x81\xaa\x45\x74\x1a\xd5\x16\x55\x52\xcd\xf7\xe2\x34\x53\x48\x0d\x4e\x8f\x06\xf2\x0e\xa8\xc1\xe9\x2d\x40\xd0\xdc\x4d\x5b\xef\x97\x2e\xb2\xed\x38\xce\xc1\x08\xde\xca\xce\x86\xaa\x39\xa6\x1e\xa7\x30\x82\xe8\x7a\x25\x13\x5b\xd1\x69\xcb\xb4\xd9\x73\x1c\xf5\x16\x4c\xe7\x9c\xee\x07\x20\xa4\xc0\xde\x4d\x04\x5f\xe1\x17\xaa\xf1\xe7\x9f\xbe\x89\x4c\x2e\x90\xa0\x7b\x3c\x4c\x6f\xc7\x55\x57\x93\x1a\xc7\x71\x0c\x5f\x21\xba\xbe\x0a\x92\xdf\x44\xef\xa0\xfa\x95\x1a\x5a\x47\xb4\xb0\xdf\xdf\x8f\xe6\x6e\xf6\xe7\x1f\xa9\x36\x8a\x89\x15\x5b\xee\x89\x13\xa6\x4d\x19\x07\xd8\xac\x2d\xc4\x55\xf1\x9a\x1e\x5e\xee\xe5\xcc\xe5\xf1\x9a\xaf\x5f\x6b\x4a\x54\xaa\xef\x4e\x88\x56\x92\x2c\x8b\xa8\x54\xeb\x9c\x1d\xd5\x41\x4c\xc2\xd6\x3c\x29\x67\xad\xe4\x2b\xa0\x52\xcd\xe9\x12\x90\x6b\xec\xca\xfc\xd9\x7e\xa9\x86\x2d\x01\x46\xee\x91\x2a\xcc\x39\xcd\x90\x44\xd7\x5f\x92\x64\xb5\x4d\xfe\xd1\x89\x2c\x0c\x47\x93\x24\x37\x51\xbf\xd1\x56\x15\xf1\x1d\x25\x94\xed\xe6\x89\x9c\xa2\x29\x94\x20\x6e\xf3\x5a\x62\x43\x55\xc7\xb5\x7b\x22\xb8\x26\xd4\x3e\xdc\x06\xdc\x52\x4e\x26\xf2\x41\xe3\x98\x72\xfe\x37\xcd\xfe\xad\x87\x43\x46\x4d\xb6\x06\x82\x0d\x62\x26\x72\x86\xe6\x9b\x52\x52\x85\x2a\x6a\x6d\xc1\x05\x0e\xc0\x5b\xa5\xdf\xf4\x42\x9b\x6d\x00\x98\x9a\x4a\x4b\x71\x3f\x2c\x2d\xac\xbf\x53\x17\x47\x3d\x74\x6e\x85\x3b\xd2\xe5\x02\x75\xed\x1c\xbf\xd3\x63\xdb\x28\xb5\xeb\xaa\x0f\xe7\x3b\xe1\x1c\x7b\x75\x65\x05\xae\x25\xc7\x94\xcb\x55\x58\xbf\xcb\x1a\xd7\xdc\xfd\xdf\x83\xc3\x74\xb8\x9d\x41\xca\xe8\x95\x99\xf5\xe1\x5a\x7c\x7b\x12\xb6\x95\x5d\xd8\x23\x7b\xb6\x7d\xf9\x24\xca\xa8\x51\x6f\x93\xda\x13\xbd\x9f\xc8\x16\xec\x73\x37\xef\xff\x9b\x7b\x38\xf1\xff\x31\x8c\x16\x51\xc0\xa7\x84\x01\xad\xe2\x80\x8f\x0e\x8e\x86\x48\x20\xf8\xcd\xaa\x2b\xc6\xcb\x74\x30\x97\x31\x89\x2f\x2f\xdc\xa5\xf4\x5f\x00\x00\x00\xff\xff\x8c\x85\xb6\xef\xc0\x0a\x00\x00") func govueRuntimeRuntimeJsBytes() ([]byte, error) { return bindataRead( @@ -147,7 +147,7 @@ func govueRuntimeRuntimeJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "govue-runtime/runtime.js", size: 2441, mode: os.FileMode(438), modTime: time.Unix(1596694115, 0)} + info := bindataFileInfo{name: "govue-runtime/runtime.js", size: 2752, mode: os.FileMode(438), modTime: time.Unix(1596696318, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/govue/govue-runtime/runtime.js b/govue/govue-runtime/runtime.js index 02a3313..f3ea6fd 100644 --- a/govue/govue-runtime/runtime.js +++ b/govue/govue-runtime/runtime.js @@ -3,6 +3,13 @@ GV.init(function (_require) { this.require = _require; var Vue = this.Vue = _require('Vue'); + var CleanVue = function () { + for (var i in Vue.options.components){ + delete Vue.options.components[i]; + } + }; + + this.VueRouter = _require('vue-router'); this.Vue.use(this.VueRouter); this.axios = _require('axios'); @@ -15,9 +22,13 @@ GV.init(function (_require) { app.$options.template = ctx.content; - // console.log(ctx.template) + var template = ctx.template; + if (cleanInlineJsCtx){ + template = cleanInlineJsCtx.template; + } + var renderer = _require('vue-server-renderer').createRenderer({ - template: cleanInlineJsCtx.template + template: template }); if (!context) { @@ -27,10 +38,12 @@ GV.init(function (_require) { context.GoVueData = "" + Base64Encode(encodeURIComponent(JSON.stringify(app.$data))) + "" renderer.renderToString(app, context, function (err, html) { if (err) { - Vue.options = {}; + CleanVue(); throw err } else { - html = html.replace("",cleanInlineJsCtx.content); + if (cleanInlineJsCtx){ + html = html.replace("",cleanInlineJsCtx.content); + } GoReturn(html); } }) @@ -44,7 +57,7 @@ GV.init(function (_require) { code: GoUseCallback, error: e.toString(), })); - Vue.options = {}; + CleanVue(); throw e } @@ -60,12 +73,12 @@ GV.init(function (_require) { code: "with(this){\n" + codes[i] + "\n}", error: e.toString(), })); - Vue.options = {}; + CleanVue(); throw e } } - Vue.options = {}; + CleanVue(); })() -}) +});