React和VUE專案推薦目錄結構

2021-10-05 15:12:54 字數 1110 閱讀 3167

api   		 介面目錄

components 公共元件(或common)

pages 元件目錄

orders 訂單目錄

components(相關元件)

store (倉庫)

actioncreators.js

actiontypes.js

index.js

reducer.js

index.js (預設元件)

style.js (預設樣式 import styled from 'styled-components';)

....

users 使用者目錄

goods 商品目錄

router 路由

static 靜態檔案

index.js

reducers.js

utils 擴充套件庫(日期格式化、狀態過濾) index.js 說白了這裡面封裝方法,其他頁面匯入下import

api  放介面檔案

components 放公共元件 例如彈框、麵包屑、底部版權等

views 元件/頁面

login 目錄

login.vue

order

index.vue 修改就彈框

物流.vue

users

index.vue

create.vue 單獨搞個元件或彈框都行

assets 放字型、、樣式等

utils 放工具、比如之前咱們寫vue移動 非同步請求

filters 過濾器

store

common

state.js

getters.js

mutations.js

actions.js

order 將每個目錄放到views功能下也行 同react 因為防止後期目錄多了找的麻煩

...carts

index.js export default store

...

目錄結構可根據專案自行定義

vue專案優化推薦

專案優化 進度條新增 移除打包之後的console babel.config.js 中設定 只在發布階段移除console 利用vue.config.js修改webpack的預設配置 自定義入口檔案 通過cdn載入外部資源 就近的獲取伺服器資源 配置element ui的cdn資源 根據不同環境定製...

spring boot推薦專案目錄結構

根目錄 com.springboot 2.實體類 domain 置於com.springboot.domain 3.資料訪問層 dao 置於com.springboot.repository 4.資料服務層 service 置於com,springboot.service,資料服務的實現介面 ser...

vue專案目錄解析

1.build資料夾 打包配置的資料夾 1.1 webpack.base.conf.js 打包的核心配置 1.2 build.js 構建生產版本,專案開發完成之後,通過build.js打包 載入base與prod,讀取完之後通過webjpack命令對專案進行打包 1.3 webpack.prod.c...