upd: view.vue.main (now can include component (import + CamelCase))

This commit is contained in:
xdrm-brackets 2017-11-30 16:46:30 +01:00
parent 2e7291929a
commit 5894aecae3
3 changed files with 50 additions and 38 deletions

View File

@ -20,8 +20,10 @@ window.api = new API("http://ndli1718/api/v/1.0/");
window.wsc = new WSClientBuilder("wss://websocket.xdrm.io"); window.wsc = new WSClientBuilder("wss://websocket.xdrm.io");
/* (3) Render view */ /* (3) Render view */
new Vue({ new Vue({
el: '#main-vue', el: '#main-vue',
render: h => h(main_vue) render: h => h(main_vue),
data: {
'server': window._SERVER
}
}) })

14
view/vue/header.vue Normal file
View File

@ -0,0 +1,14 @@
<template>
<div id='HEADER'>
HEADER CONTENT (component)
</div>
</template>
<script>
export default {
name: 'HEADER'
}
</script>

View File

@ -1,30 +1,25 @@
<template> <template>
<div id="root"> <div id="root">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2> <header-comp></header-comp>
<ul>
<li><a href="https://vuejs.org" target="_blank">Core Docs</a></li> <span>message: {{ msg }}</span>
<li><a href="https://forum.vuejs.org" target="_blank">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank">Twitter</a></li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li><a href="http://router.vuejs.org/" target="_blank">vue-router</a></li>
<li><a href="http://vuex.vuejs.org/" target="_blank">vuex</a></li>
<li><a href="http://vue-loader.vuejs.org/" target="_blank">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank">awesome-vue</a></li>
</ul>
</div> </div>
</template> </template>
<script> <script>
import header_vue from './header.vue';
export default { export default {
name: 'root', name: 'root',
data () { data(){ return {
return { msg: 'Main vue component'
msg: 'Welcome to Your Vue.js App' }; },
} components: {
'HeaderComp': header_vue
} }
} }
</script> </script>
@ -57,3 +52,4 @@ a {
color: #42b983; color: #42b983;
} }
</style> </style>