diff options
author | Yukai Huang | 2016-12-26 03:38:07 +0000 |
---|---|---|
committer | Yukai Huang | 2016-12-26 03:38:07 +0000 |
commit | 1e276fb37a4ed8e19234de7192d8593314f53799 (patch) | |
tree | 4bd08869984692cc6b914bc602ecb0bb452e8b61 /public | |
parent | 8cf849e825e96510c064479bbf89b595e6728511 (diff) | |
parent | 99dd10772422b66b7f98f1483b5fa3225e3e86e0 (diff) |
Merge branch 'Yukai/#3-vue-setup' into 'frontend-next'
Vue setup
See merge request !2
Diffstat (limited to '')
-rw-r--r-- | public/js/components/HelloWorld.vue | 21 | ||||
-rw-r--r-- | public/js/cover.js | 9 | ||||
-rw-r--r-- | public/js/index.js | 1 | ||||
-rw-r--r-- | public/js/views/Cover.vue | 15 | ||||
-rw-r--r-- | public/views/index.ejs | 1 |
5 files changed, 47 insertions, 0 deletions
diff --git a/public/js/components/HelloWorld.vue b/public/js/components/HelloWorld.vue new file mode 100644 index 00000000..d8e3007f --- /dev/null +++ b/public/js/components/HelloWorld.vue @@ -0,0 +1,21 @@ +<template> + <h1>{{ message }}</h1> +</template> + +<script> +export default { + name: 'HelloWorld', + + data() { + return { + message: 'Hello Vue' + } + } +} +</script> + +<style scoped> +h1 { + color: blue; +} +</style> diff --git a/public/js/cover.js b/public/js/cover.js index 2f35bd28..b8886849 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -9,6 +9,7 @@ var urlpath = common.urlpath; var resetCheckAuth = common.resetCheckAuth; var getLoginState = common.getLoginState; var clearLoginState = common.clearLoginState; +var loginStateChangeEvent = common.loginStateChangeEvent; var historyModule = require('./history'); var parseStorageToHistory = historyModule.parseStorageToHistory; @@ -27,6 +28,14 @@ var saveAs = require('file-saver').saveAs; var List = require('list.js'); var S = require('string'); +import Cover from './views/Cover'; +import Vue from 'vue'; + +new Vue({ + el: '#cover-app', + render: (h) => h(Cover) +}) + var options = { valueNames: ['id', 'text', 'timestamp', 'fromNow', 'time', 'tags', 'pinned'], item: '<li class="col-xs-12 col-sm-6 col-md-6 col-lg-4">\ diff --git a/public/js/index.js b/public/js/index.js index 96580fe3..4a466245 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -29,6 +29,7 @@ var DROPBOX_APP_KEY = common.DROPBOX_APP_KEY; var noteurl = common.noteurl; var checkLoginStateChanged = common.checkLoginStateChanged; +var loginStateChangeEvent = common.loginStateChangeEvent; var extra = require('./extra'); var md = extra.md; diff --git a/public/js/views/Cover.vue b/public/js/views/Cover.vue new file mode 100644 index 00000000..767d087f --- /dev/null +++ b/public/js/views/Cover.vue @@ -0,0 +1,15 @@ +<template> + <hello-world /> +</template> + +<script> +import HelloWorld from '../components/HelloWorld'; + +export default { + name: 'Cover', + + components: { + HelloWorld + } +} +</script> diff --git a/public/views/index.ejs b/public/views/index.ejs index adcdd34d..5b84f4fc 100644 --- a/public/views/index.ejs +++ b/public/views/index.ejs @@ -30,6 +30,7 @@ <div class="site-wrapper"> <div class="site-wrapper-inner"> <div class="cover-container"> + <div id="cover-app"></div> <div class="masthead clearfix"> <div class="inner"> |