@@ -11,7 +11,7 @@
data () {
return {}
},
- ready () {
+ mounted () {
},
beforeDestroy () {
diff --git a/src/config/config.js b/src/config/config.js
index c6c37b5..e670dd7 100644
--- a/src/config/config.js
+++ b/src/config/config.js
@@ -1,6 +1,3 @@
-/**
- * Created by aresn on 16/7/18.
- */
import Env from './env';
let config = {
diff --git a/src/directives/time.js b/src/directives/time.js
deleted file mode 100644
index 3b1970d..0000000
--- a/src/directives/time.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Created by aresn on 16/7/18.
- */
-export default {
- bind () {
-
- },
- update () {
- this.el.innerHTML = new Date();
- this.timeout = setInterval(() => {
- this.el.innerHTML = new Date();
- })
- },
- unbind () {
- clearInterval(this.timeout);
- }
-};
\ No newline at end of file
diff --git a/src/filters/number-separator.js b/src/filters/number-separator.js
deleted file mode 100644
index af9a77a..0000000
--- a/src/filters/number-separator.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Created by aresn on 16/7/4.
- */
-/**
-* 千位分隔符
-* */
-export default function (value) {
- return value.toString().replace(/\B(?=(\d{3})+$)/g,',');
-}
\ No newline at end of file
diff --git a/src/images/logo.png b/src/images/logo.png
index ff2bf7f..f7e9391 100644
Binary files a/src/images/logo.png and b/src/images/logo.png differ
diff --git a/src/libs/util.js b/src/libs/util.js
index 265e245..dcd4446 100644
--- a/src/libs/util.js
+++ b/src/libs/util.js
@@ -1,11 +1,9 @@
-/**
- * Created by aresn on 16/7/18.
- */
let util = {
};
-util.alert = function(content) {
- window.alert(content);
+util.title = function (title) {
+ title = title ? title + ' - Home' : 'iView project';
+ window.document.title = title;
};
export default util;
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index f598917..ee5bb14 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,37 +1,34 @@
-/**
- * Created by aresn on 16/6/20.
- */
import Vue from 'vue';
+import iView from 'iview';
import VueRouter from 'vue-router';
-import App from 'components/app.vue';
import Routers from './router';
-import Env from './config/env';
-import iView from 'iview';
+import Util from './libs/util';
+import App from './app.vue';
import 'iview/dist/styles/iview.css';
Vue.use(VueRouter);
Vue.use(iView);
-// 开启debug模式
-Vue.config.debug = true;
-
// 路由配置
-let router = new VueRouter({
- // 是否开启History模式的路由,默认开发环境开启,生产环境不开启。如果生产环境的服务端没有进行相关配置,请慎用
- history: Env != 'production'
+const RouterConfig = {
+ mode: 'history',
+ routes: Routers
+};
+const router = new VueRouter(RouterConfig);
+
+router.beforeEach((to, from, next) => {
+ iView.LoadingBar.start();
+ Util.title(to.meta.title);
+ next();
});
-router.map(Routers);
-
-router.beforeEach(() => {
+router.afterEach((to, from, next) => {
+ iView.LoadingBar.finish();
window.scrollTo(0, 0);
});
-router.afterEach(() => {
-
-});
-
-router.redirect({
- '*': "/index"
+new Vue({
+ el: '#app',
+ router: router,
+ render: h => h(App)
});
-router.start(App, '#app');
\ No newline at end of file
diff --git a/src/router.js b/src/router.js
index cd5c938..dc71524 100644
--- a/src/router.js
+++ b/src/router.js
@@ -1,11 +1,10 @@
-/**
- * Created by aresn on 16/8/22.
- */
-const routers = {
- '/index': {
- component (resolve) {
- require(['./views/index.vue'], resolve);
- }
+const routers = [
+ {
+ path: '/',
+ meta: {
+ title: ''
+ },
+ component: (resolve) => require(['./views/index.vue'], resolve)
}
-};
+];
export default routers;
\ No newline at end of file
diff --git a/src/template/index.ejs b/src/template/index.ejs
index 202c267..f7097f9 100644
--- a/src/template/index.ejs
+++ b/src/template/index.ejs
@@ -1,14 +1,16 @@
+
-
Webpack App
+
iView project
-
+
+
-
\ No newline at end of file
+