Remove un-used Vue files + Create Fruits directory & Fruit details pages
This commit is contained in:
17
src/App.vue
17
src/App.vue
@@ -1,9 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div id="nav">
|
|
||||||
<router-link to="/">Home</router-link> |
|
|
||||||
<router-link to="/about">About</router-link>
|
|
||||||
</div>
|
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -16,17 +12,4 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav {
|
|
||||||
padding: 30px;
|
|
||||||
|
|
||||||
a {
|
|
||||||
font-weight: bold;
|
|
||||||
color: #2c3e50;
|
|
||||||
|
|
||||||
&.router-link-exact-active {
|
|
||||||
color: #42b983;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB |
12
src/main.js
12
src/main.js
@@ -1,12 +1,12 @@
|
|||||||
import Vue from 'vue';
|
import Vue from "vue";
|
||||||
import App from './App.vue';
|
import App from "./App.vue";
|
||||||
import router from './router';
|
import router from "./router";
|
||||||
import store from './store';
|
import store from "./store";
|
||||||
|
|
||||||
Vue.config.productionTip = false;
|
Vue.config.productionTip = false;
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
store,
|
store,
|
||||||
render: (h) => h(App),
|
render: h => h(App)
|
||||||
}).$mount('#app');
|
}).$mount("#app");
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
import Vue from 'vue';
|
import Vue from "vue";
|
||||||
import VueRouter from 'vue-router';
|
import VueRouter from "vue-router";
|
||||||
import Home from '../views/Home.vue';
|
import Fruits from "../views/Fruits.vue";
|
||||||
|
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: "/",
|
||||||
name: 'Home',
|
name: "Fruits",
|
||||||
component: Home,
|
component: Fruits
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/about',
|
path: "/fruit",
|
||||||
name: 'About',
|
name: "Fruit",
|
||||||
// route level code-splitting
|
// route level code-splitting
|
||||||
// this generates a separate chunk (about.[hash].js) for this route
|
// this generates a separate chunk (about.[hash].js) for this route
|
||||||
// which is lazy-loaded when the route is visited.
|
// which is lazy-loaded when the route is visited.
|
||||||
component: () => import(/* webpackChunkName: "about" */ '../views/About.vue'),
|
component: () => import(/* webpackChunkName: "about" */ "../views/Fruit.vue")
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'history',
|
mode: "history",
|
||||||
base: process.env.BASE_URL,
|
base: process.env.BASE_URL,
|
||||||
routes,
|
routes
|
||||||
});
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
import Vue from 'vue';
|
import Vue from "vue";
|
||||||
import Vuex from 'vuex';
|
import Vuex from "vuex";
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
state: {
|
state: {},
|
||||||
},
|
mutations: {},
|
||||||
mutations: {
|
actions: {},
|
||||||
},
|
modules: {}
|
||||||
actions: {
|
|
||||||
},
|
|
||||||
modules: {
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="about">
|
|
||||||
<h1>This is an about page</h1>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
5
src/views/Fruit.vue
Normal file
5
src/views/Fruit.vue
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>Fruit Details</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
11
src/views/Fruits.vue
Normal file
11
src/views/Fruits.vue
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h1>Fruits Directory</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "Fruits"
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="home">
|
|
||||||
<img alt="Vue logo" src="../assets/logo.png">
|
|
||||||
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// @ is an alias to /src
|
|
||||||
import HelloWorld from '@/components/HelloWorld.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'Home',
|
|
||||||
components: {
|
|
||||||
HelloWorld,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user