Skeleton of vue router test.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Domo
|
||||
|
||||
> Domotic automation
|
||||
> Domotic
|
||||
|
||||
## Build Setup
|
||||
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta charset='utf-8' />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
|
||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black- translucent">
|
||||
<meta name="description" content="Domo controller">
|
||||
<meta name="author" content="NADAL Jean-Baptiste">
|
||||
<link rel="icon" href="/static/favicon.ico">
|
||||
<link rel="apple-touch-icon" href="/static/favicon.png">
|
||||
<title>Domo</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Domo",
|
||||
"version": "0.1.0",
|
||||
"description": "Domotic automation",
|
||||
"description": "Domotic",
|
||||
"author": "NADAL Jean-Baptiste",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -12,7 +12,9 @@
|
||||
"test": "npm run unit && npm run e2e"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^1.0.17"
|
||||
"vue": "^1.0.17",
|
||||
"vue-router": "~0.7.11",
|
||||
"vue-mdl": "~0.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.0.0",
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<img class="logo" src="./assets/logo.png">
|
||||
<hello></hello>
|
||||
<p>
|
||||
Welcome to your Vue.js app. To get started, take a look at the
|
||||
<a href="https://github.com/vuejs-templates/webpack#folder-structure" target="_blank">README</a>
|
||||
of this template. If you have any issues with the setup, please file an issue at this template's repository.
|
||||
</p>
|
||||
<p>
|
||||
For advanced configurations, checkout the docs for
|
||||
<a href="http://webpack.github.io/" target="_blank">Webpack</a> and
|
||||
<a href="http://vuejs.github.io/vue-loader/" target="_blank">vue-loader</a>.
|
||||
</p>
|
||||
<p>
|
||||
You may also want to checkout
|
||||
<a href="https://github.com/vuejs/vue-router/" target="_blank">vue-router</a> for routing and
|
||||
<a href="https://github.com/vuejs/vuex/" target="_blank">vuex</a> for state management.
|
||||
<!-- use v-link directive for navigation. -->
|
||||
<a v-link="{ path: '/foo' }">Go to Foo</a>
|
||||
<a v-link="{ path: '/bar' }">Go to Bar</a>
|
||||
</p>
|
||||
<!-- use router-view element as route outlet -->
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import App from './App'
|
||||
/* import routerMap from './router' */
|
||||
|
||||
/* eslint-disable no-new */
|
||||
new Vue({
|
||||
el: 'body',
|
||||
components: { App }
|
||||
})
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
/*var router = new VueRouter()
|
||||
|
||||
routerMap(router)
|
||||
|
||||
router.start(App, 'app')
|
||||
*/
|
||||
32
src/ui/Domo/src/router.js
Normal file
32
src/ui/Domo/src/router.js
Normal file
@@ -0,0 +1,32 @@
|
||||
// define some components
|
||||
var Foo = Vue.extend({
|
||||
template: '<p>This is foo!</p>'
|
||||
})
|
||||
|
||||
var Bar = Vue.extend({
|
||||
template: '<p>This is bar!</p>'
|
||||
})
|
||||
|
||||
|
||||
module.exports = function(router){
|
||||
router.map({
|
||||
'/foo': {
|
||||
component: Foo
|
||||
},
|
||||
'/bar': {
|
||||
component: Bar
|
||||
},
|
||||
'*': {
|
||||
component: require('./components/index.vue')
|
||||
},
|
||||
'/': {
|
||||
component: require('./components/index.vue')
|
||||
},
|
||||
'/list': {
|
||||
component: require('./components/list.vue')
|
||||
},
|
||||
'/asi': {
|
||||
component: require('./components/asi.vue')
|
||||
}
|
||||
})
|
||||
}
|
||||
BIN
src/ui/Domo/static/favicon.ico
Normal file
BIN
src/ui/Domo/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/ui/Domo/static/favicon.png
Normal file
BIN
src/ui/Domo/static/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Reference in New Issue
Block a user