Vue Trello Clone 项目教程
vue-trello-cloneA simple Trello clone项目地址:https://gitcode.com/gh_mirrors/vu/vue-trello-clone
1. 项目的目录结构及介绍
vue-trello-clone/
├── public/
│ ├── index.html
│ └── favicon.ico
├── src/
│ ├── assets/
│ │ └── logo.png
│ ├── components/
│ │ ├── Board.vue
│ │ ├── List.vue
│ │ └── Card.vue
│ ├── store/
│ │ ├── index.js
│ │ └── modules/
│ ├── views/
│ │ ├── Home.vue
│ │ └── About.vue
│ ├── App.vue
│ ├── main.js
│ └── router.js
├── package.json
├── README.md
└── vue.config.js
目录结构介绍
- public/: 包含公共资源,如
index.html
和favicon.ico
。 - src/: 源代码目录。
- assets/: 静态资源,如图片。
- components/: Vue 组件,如
Board.vue
,List.vue
,Card.vue
。 - store/: Vuex 状态管理,包含
index.js
和模块目录。 - views/: 页面视图组件,如
Home.vue
,About.vue
。 - App.vue: 主应用组件。
- main.js: 入口文件。
- router.js: 路由配置文件。
- package.json: 项目依赖和脚本配置。
- README.md: 项目说明文档。
- vue.config.js: Vue 项目配置文件。
2. 项目的启动文件介绍
main.js
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
Vue.config.productionTip = false;
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app');
文件介绍
- 导入 Vue 和相关模块。
- 配置 Vue 实例,包括路由和状态管理。
- 挂载 Vue 实例到
#app
元素。
3. 项目的配置文件介绍
package.json
{
"name": "vue-trello-clone",
"version": "1.0.0",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-service": "^4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
}
}
文件介绍
- name: 项目名称。
- version: 项目版本。
- scripts: 脚本命令,如
serve
,build
,lint
。 - dependencies: 生产环境依赖,如
vue
,vue-router
,vuex
。 - devDependencies: 开发环境依赖,如
@vue/cli-plugin-babel
,@vue/cli-plugin-eslint
。
vue.config.js
module.exports = {
publicPath: '/',
outputDir: 'dist',
lintOnSave: true,
devServer: {
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
pathRewrite: { '^/api': '' }
}
}
}
vue-trello-cloneA simple Trello clone项目地址:https://gitcode.com/gh_mirrors/vu/vue-trello-clone