Browse Source

去掉consile.log

master
3136352472 5 years ago
parent
commit
4757a75ce1
  1. 8
      govue/bindata.go
  2. 19
      govue/govue-runtime/header.js
  3. 2
      govue/govue-runtime/runtime.js
  4. 5
      static/index.html
  5. 1
      static/use.js

8
govue/bindata.go
File diff suppressed because it is too large
View File

19
govue/govue-runtime/header.js

@ -103,7 +103,7 @@ function GoVueRender(template, app, context) {
var raw = GoReadFile(template);
console.log(vuessr);
// console.log(vuessr);
var renderer = vuessr.createRenderer({
template: raw
@ -207,6 +207,12 @@ var GoVueIgnore = function () {
* 忽略前置
*/
this.ignore = function () {
var templateTagNodes = document.getElementsByTagName("template");
for(var i = 0;i<templateTagNodes.length;i++){
templateTagNodes[i].outerHTML = templateTagNodes[i].outerHTML.replace(/<template/g,"<gv-template").replace(/<\/template>/g,"</gv-template>")
}
var gv_ignore = document.getElementsByTagName("gv-ignore");
gv_ignore_len = gv_ignore.length;
for (var i = gv_ignore_len - 1; i >= 0; i--) {
@ -215,7 +221,8 @@ var GoVueIgnore = function () {
}
var gv_ignore_class = document.querySelectorAll("[gv-ignore]");
gv_ignore_class_len = gv_ignore_class.length;
// console.log("gv_ignore_class_len",gv_ignore_class_len)
// console.log(document.innerHTML);
// console.log("gv_ignore_class_len",gv_ignore_class_len)
for (var i = 0; i < gv_ignore_class_len; i++) {
if (!gv_ignore_class_map[i]) {
gv_ignore_class_map[i] = {};
@ -232,6 +239,14 @@ var GoVueIgnore = function () {
gv_ignore_class[i].removeAttribute("gv-ignore");
gv_ignore_class[i].setAttribute("gv-ignore-val", "gv-ignore-" + i)
}
var templateTagNodes = document.getElementsByTagName("gv-template");
for(var i = 0;i<templateTagNodes.length;i++){
templateTagNodes[i].outerHTML = templateTagNodes[i].outerHTML.replace(/<gv-template/g,"<template").replace(/<\/gv-template>/g,"</template>")
}
};
/**

2
govue/govue-runtime/runtime.js

@ -21,7 +21,7 @@ if (!IS_VUE_SSR) {
var goVueIgnore = new GoVueIgnore();
goVueIgnore.ignore();
// console.log(document.innerHTML);
} catch (e) {
console.log("goVueIgnore.ignore:" + e);
}

5
static/index.html

@ -11,10 +11,15 @@
<div id="app">
<div class="content">
<my-title></my-title>
<template v-for="desc in descs">
<li >
<a v-on:click="click" gv-ignore>{{desc}}</a>
</li>
</template>
<br>
<br>
<br>
<a href="#" v-on:click="ssr" gv-ignore>{{a}}</a>
</div>
</div>

1
static/use.js

@ -23,6 +23,7 @@ GoUseRegistered("index", function (query) {
data: {
"desc": "基础golang开发的一套vue服务端渲染方案",
"a": "官方ssr模式",
"descs":["123","456"]
},
});
Loading…
Cancel
Save