summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorYukai Huang2016-12-26 03:38:07 +0000
committerYukai Huang2016-12-26 03:38:07 +0000
commit1e276fb37a4ed8e19234de7192d8593314f53799 (patch)
tree4bd08869984692cc6b914bc602ecb0bb452e8b61 /public/js
parent8cf849e825e96510c064479bbf89b595e6728511 (diff)
parent99dd10772422b66b7f98f1483b5fa3225e3e86e0 (diff)
Merge branch 'Yukai/#3-vue-setup' into 'frontend-next'
Vue setup See merge request !2
Diffstat (limited to 'public/js')
-rw-r--r--public/js/components/HelloWorld.vue21
-rw-r--r--public/js/cover.js9
-rw-r--r--public/js/index.js1
-rw-r--r--public/js/views/Cover.vue15
4 files changed, 46 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>