Skeleton of vue router test.

This commit is contained in:
2016-03-25 22:34:33 +01:00
parent 0a2ecc1087
commit a2e4785ee6
8 changed files with 65 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
# Domo # Domo
> Domotic automation > Domotic
## Build Setup ## Build Setup

View File

@@ -1,7 +1,17 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <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> <title>Domo</title>
</head> </head>
<body> <body>

View File

@@ -1,7 +1,7 @@
{ {
"name": "Domo", "name": "Domo",
"version": "0.1.0", "version": "0.1.0",
"description": "Domotic automation", "description": "Domotic",
"author": "NADAL Jean-Baptiste", "author": "NADAL Jean-Baptiste",
"private": true, "private": true,
"scripts": { "scripts": {
@@ -12,7 +12,9 @@
"test": "npm run unit && npm run e2e" "test": "npm run unit && npm run e2e"
}, },
"dependencies": { "dependencies": {
"vue": "^1.0.17" "vue": "^1.0.17",
"vue-router": "~0.7.11",
"vue-mdl": "~0.4.0"
}, },
"devDependencies": { "devDependencies": {
"babel-core": "^6.0.0", "babel-core": "^6.0.0",

View File

@@ -1,22 +1,12 @@
<template> <template>
<div id="app"> <div id="app">
<img class="logo" src="./assets/logo.png">
<hello></hello>
<p> <p>
Welcome to your Vue.js app. To get started, take a look at the <!-- use v-link directive for navigation. -->
<a href="https://github.com/vuejs-templates/webpack#folder-structure" target="_blank">README</a> <a v-link="{ path: '/foo' }">Go to Foo</a>
of this template. If you have any issues with the setup, please file an issue at this template's repository. <a v-link="{ path: '/bar' }">Go to Bar</a>
</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.
</p> </p>
<!-- use router-view element as route outlet -->
<router-view></router-view>
</div> </div>
</template> </template>

View File

@@ -1,8 +1,19 @@
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App' import App from './App'
/* import routerMap from './router' */
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: 'body', el: 'body',
components: { App } components: { App }
}) })
Vue.use(VueRouter);
/*var router = new VueRouter()
routerMap(router)
router.start(App, 'app')
*/

32
src/ui/Domo/src/router.js Normal file
View 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')
}
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB