Browse Source

init

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

22
static/index.html

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