diff options
author | Yukai Huang | 2016-12-24 11:50:57 +0800 |
---|---|---|
committer | Yukai Huang | 2016-12-24 11:50:57 +0800 |
commit | 99dd10772422b66b7f98f1483b5fa3225e3e86e0 (patch) | |
tree | b9e4675d4ee9d6b242763ded01f7157a771bf580 /public/js | |
parent | a06fad974e66c8c5854985fe12fbadbb43cc9c7e (diff) |
Basic setup for Vue app
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/components/HelloWorld.vue | 21 | ||||
-rw-r--r-- | public/js/cover.js | 6 | ||||
-rw-r--r-- | public/js/views/Cover.vue | 15 |
3 files changed, 42 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 4696203e..b8886849 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -28,8 +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/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> |