mirror of
https://github.com/pinry/pinry.git
synced 2026-01-15 11:42:07 +01:00
Feature: Add vue-router as default function
This commit is contained in:
committed by
Isaac Bythewood
parent
553dec9048
commit
707825769b
@@ -12,11 +12,13 @@
|
||||
"buefy": "^0.8.8",
|
||||
"core-js": "^3.3.2",
|
||||
"vue": "^2.6.10",
|
||||
"vue-masonry": "^0.11.8"
|
||||
"vue-masonry": "^0.11.8",
|
||||
"vue-router": "^3.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.0.0",
|
||||
"@vue/cli-plugin-eslint": "^4.0.0",
|
||||
"@vue/cli-plugin-router": "^4.0.5",
|
||||
"@vue/cli-service": "^4.0.0",
|
||||
"@vue/eslint-config-airbnb": "^4.0.0",
|
||||
"babel-eslint": "^10.0.3",
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<Home></Home>
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Home from './pages/Home.vue';
|
||||
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {
|
||||
Home,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import Buefy from 'buefy';
|
||||
import Vue from 'vue';
|
||||
import { VueMasonryPlugin } from 'vue-masonry';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
@@ -9,5 +10,6 @@ Vue.use(Buefy);
|
||||
Vue.use(VueMasonryPlugin);
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
render: h => h(App),
|
||||
}).$mount('#app');
|
||||
|
||||
19
pinry-spa/src/router/index.js
Normal file
19
pinry-spa/src/router/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import Home from '../views/Home.vue';
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: Home,
|
||||
},
|
||||
];
|
||||
|
||||
const router = new VueRouter({
|
||||
routes,
|
||||
});
|
||||
|
||||
export default router;
|
||||
@@ -7431,6 +7431,10 @@ vue-masonry@^0.11.8:
|
||||
masonry-layout "^4.2.2"
|
||||
vue "^2.0.0"
|
||||
|
||||
vue-router@^3.1.3:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.npm.taobao.org/vue-router/download/vue-router-3.1.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.1.3.tgz#e6b14fabc0c0ee9fda0e2cbbda74b350e28e412b"
|
||||
|
||||
vue-style-loader@^4.1.0:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8"
|
||||
|
||||
Reference in New Issue
Block a user