Browse Source

init

master
public_host 5 years ago
parent
commit
66d64890cc
  1. 14
      static/index.html

14
static/index.html

@ -39,6 +39,7 @@
pre::-webkit-scrollbar { pre::-webkit-scrollbar {
width: 0 !important width: 0 !important
} }
a { a {
text-decoration: none; text-decoration: none;
color: darkslategrey; color: darkslategrey;
@ -50,7 +51,7 @@
<!--gv-start--> <!--gv-start-->
<div id="app"> <div id="app">
<div class="content"> <div class="content">
<govue-title></govue-title>
<govue-title :govue_title="title"></govue-title>
<p>{{desc}}</p> <p>{{desc}}</p>
<div>当前版本号:{{version}}</div> <div>当前版本号:{{version}}</div>
<br> <br>
@ -64,15 +65,19 @@
<!--gv-end--> <!--gv-end-->
<script gv-src> <script gv-src>
Vue.component('govue-title', { Vue.component('govue-title', {
template: '<h1 id="title">govue</h1>'
props:["govue_title"],
template: '<h1 id="title">{{govue_title}}</h1>'
}); });
if (isBrowser) { if (isBrowser) {
GoHtmlSrc = "" GoHtmlSrc = ""
} }
var app = new Vue({ var app = new Vue({
data: { data: {
title: "govue",
desc: "基础golang开发的一套vue服务端渲染方案", desc: "基础golang开发的一套vue服务端渲染方案",
version: "0", version: "0",
code: GoHtmlSrc, code: GoHtmlSrc,
@ -86,14 +91,15 @@
}); });
if (!isBrowser) { if (!isBrowser) {
console.log(GoHost + "/govue.version")
console.log(GoHost + "/govue.version");
axios.get("http://" + GoHost + "/govue.version").then(function (data) { axios.get("http://" + GoHost + "/govue.version").then(function (data) {
app.version = data.data.version app.version = data.data.version
}) })
} }
GoVueMount(app, { GoVueMount(app, {
title: "govue"
title: "govue-基础golang开发的一套vue服务端渲染方案",
govue_title: "",//使用的组件,data返回的数据需要全部在context中指定,原因未知
}, "#app") }, "#app")
</script> </script>
</body> </body>
Loading…
Cancel
Save