Skip to content

Instantly share code, notes, and snippets.

@HuanMeng0
Last active April 28, 2016 13:19
Show Gist options
  • Save HuanMeng0/0403649595dfc829fc9754720d1bb9bd to your computer and use it in GitHub Desktop.
Save HuanMeng0/0403649595dfc829fc9754720d1bb9bd to your computer and use it in GitHub Desktop.
/* Require Bootstrap */
window.$ = window.jQuery = require('jquery');
require('bootstrap-sass');
$( document ).ready(function() {
console.log($.fn.tooltip.Constructor.VERSION);
});
/* Require Bootstrap END*/
import Vue from 'vue';
import VueRouter from "vue-router";
var VueResource = require('vue-resource');
Vue.use(VueRouter);
Vue.use(VueResource);
import view_i from "./t/i.vue";
import view_timeline from "./t/timeline.vue";
import view_talk from "./t/talk.vue";
Vue.config.debug = true;
var App = Vue.extend({});
new Vue({
el: 'body',
components: {
'site-header': require('./t/header.vue')
}
});
var router = new VueRouter();
router.map({
'/i':{
name:'i',
component:view_i
},
'/timeline': {
name:'timeline',
component: view_timeline
},
'/talk': {
name:'talk',
component: view_talk
}
});
router.redirect({
'*':"/talk"
});
router.start(App, 'body');
<template>
<div>
<a v-link="{ name: 'i' }">go to i</a>
<a v-link="{ name: 'timeline' }"> go to tl</a>
</div>
</template>
<script>
export default{
}
</script>
<!DOCTYPE html>
<html>
<head>
<title>Project</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="{{ elixir('css/app.css') }}">
</head>
<body>
<div id="app">
<site-header></site-header>
<router-view> </router-view>
</div>
<script src="{{ elixir('js/app.js') }}"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment