Skip to content

Commit

Permalink
Merge pull request #8 from terwer/develop
Browse files Browse the repository at this point in the history
 Fix file
  • Loading branch information
terwer authored Jan 20, 2019
2 parents df3ea11 + 225ab7c commit 6af5ccd
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@
<!--注意此次必须要放在此目录下才能被访问到 -->
<targetPath>META-INF/resources</targetPath>
<includes>
<!-- 客户端渲染 -->
<!-- 客户端渲染
<include>dist/*.css</include>
<include>dist/*.js</include>
-->
<!-- 服务端渲染 -->
<include>ssrdist/*.css</include>
<include>ssrdist/*.js</include>
<include>ssrdist/**</include>
</includes>
</resource>
</resources>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/terwergreen/next/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class WebConfig implements WebMvcConfigurer {
public void addResourceHandlers(ResourceHandlerRegistry registry) {
logger.info("添加静态资源映射");
// 静态资源映射
registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/dist/");
// registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/dist/");
registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/ssrdist/");
}
}
6 changes: 6 additions & 0 deletions src/main/webapp/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
type="text"/>
<button @click="showMessage">显示信息</button>
<h2 class="message">{{ message }}</h2>
<Index/>
</div>
</template>

<script>
import Index from "./src/components/themes/default/Index.vue"
export default {
name: "App",
components: {
Index
},
data() {
return {
message: 'Hello World',
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"description": "next vue project",
"main": "src/main.js",
"scripts": {
"clean": "rimraf dist && rimraf ssrdist",
"clean": "rimraf dist && rimraf ssrdist && rimraf ssrclientdist",
"serve": "webpack-dev-server --mode development",
"build": "rimraf dist && webpack --mode production",
"build:client": "rimraf ssrclientdist && webpack --mode production --renderMode server:client",
"build:server": "rimraf ssrdist && webpack --mode production --renderMode server:server",
"build:server-bundle": "mv ssrclientdist/client.js ssrdist/client.js && cat ssr/event-loop.js ssr/nashorn-polyfill.js ssrdist/server.js ssr/return-render-function.js > ssrdist/server-bundle.js",
"build:server-bundle": "rm ssrdist/index.html && mv ssrclientdist/client.js ssrdist/client.js && cat ssr/event-loop.js ssr/nashorn-polyfill.js ssrdist/server.js ssr/return-render-function.js > ssrdist/server-bundle.js && rm ssrdist/server.js",
"build:ssr":"npm run build:client && npm run build:server && npm run build:server-bundle"
},
"author": "Terwer",
Expand Down
26 changes: 26 additions & 0 deletions src/main/webapp/src/components/themes/default/Index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div id="index">
Index
<!--<Header :title="title"/>-->
</div>
</template>

<script>
// import Header from './Header.vue'
export default {
name: "Index",
data: function () {
return {
title: 'Index page'
}
},
// components: {
// Header
// }
}
</script>

<style scoped>
@import 'style.css';
</style>
97 changes: 97 additions & 0 deletions src/main/webapp/src/components/themes/default/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
Theme Name: terwer
Theme URL: http://www.terwergreen.com
Description: 本主题是一款适合博客、新闻资讯、自媒体的主题模板。基于bootstrap响应式布局,自适应PC、手机、平板等多种设备浏览。包含普通文章、专题、视频、图集、下载五中文章类型,多种文章页模板。自带前端用户中心,前端登录注册、资料编辑、投稿、文章编辑、评论管理、收藏管理、用户关注一应俱全。文章列表及评论列表AJAX加载。视频支持本地上传、视频链接及视频平台视频。
Author: 倚楼听雨
Author URI: http://www.terwergreen.com
Tags:blog
Version: 1.0
*/
* {
box-sizing: border-box !important;
}

html {
overflow-x: hidden;
}

body {
font-family: "Microsoft Yahei", sans-serif !important;
padding: 0 !important;
color: #666;
margin: 0 auto;
overflow-x: hidden;
}

body h1, body h2, body h3, body h4, body h5, body h6 {
margin-top: 0;
margin-bottom: 0;
}

body a {
color: #009688;
}

body a:hover {
text-decoration: none;
color: #00a4ff;
}

a:hover {
color: #009688;
transition: all .3s;
}

ul {
margin: 0 !important;
padding: 0;
}

li {
list-style: none;
}

button[disabled], html input[disabled] {
background: #fafafa !important;
color: #999 !important;
}

.hidden {
display: none;
}

.hid {
display: none;
}

@media (min-width: 1200px) {
.container {
width: 1200px !important;
}
}

.fl {
float: left;
}

.fr {
float: right;
}

.pd3040 {
padding: 30px 40px !important;
}

.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
padding-right: 10px !important;
padding-left: 10px !important;
}

.row {
margin-right: -10px !important;
margin-left: -10px !important;
}

.boxshadow{
box-shadow: 0 2px 6px 0 rgba(63,74,105,.16);
}
2 changes: 1 addition & 1 deletion src/main/webapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = (env, argv) => {
]
},
devServer: {
open: true,
open: false,
hot: true,
port: 8000
},
Expand Down

0 comments on commit 6af5ccd

Please sign in to comment.