本项目主要演示
yarn install
yarn run serve
编译打包项目,用于生产环境 ps: 如果使用Nginx,需设置nginx.conf,参考链接设置
yarn run build
import Contact from "@/components/Contact";
import Main from "@/components/Main";
import Products from "@/components/Products";
import Partners from "@/components/Partners";
const routes = [
{path: '/', name: "/", component: Main},
{path: '/products', name: "products", component: Products},
{path: '/partners', name: "partners", component: Partners},
{path: '/contact', name: "contact", component: Contact},
{path: '*', name: "/"}
]
export default routes;
这里只存储了接口的url
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
const state = {
devUrl: "http://127.0.0.1:8010/atfu"
};
const store = new Vuex.Store({
state
});
export default store;