vue vant jq 實際專案開發

2021-10-05 13:32:49 字數 2336 閱讀 5368

專案結構:

1、html頁面

2、js 當前頁面主要邏輯

3、common.js 公共邏輯, jq寫法

① 過濾器

② 公共方法

4、component.js 公共元件

1、html頁面:index.html

2、當前頁面js邏輯  index.js

new vue(,

authlimit: {}

};}, methods: ,

mounted()

if(this.authlimit.yhgl)

}});

3、common.js

$(function()

});// 校驗使用者登入狀態

if(location.href.indexof("/login.html") == -1 && location.href.indexof("/psd.html") == -1) getuser();

});// vue filters - 專案型別

vue.filter('projecttype', function(value,type)

} return type == "str" ? desp[0] : desp;

});// vue filters - 專案型別

vue.filter('projecttype', function(value,type)

} return type == "str" ? desp[0] : desp;

});// 獲取專案型別

function getprojecttypes(),

async: false,

success:function(result)

types.push(d);

}}else

} });

return types;

}

4、component.js

① foot 元件:

// 底部導航欄

vue.component("foot", ,

xtgl_db: {},

xtgl_lc: {},

xtgl_db_totle: 0,

xtgl_lc_totle: 0,

khgl_db: {},

khgl_lc: {},

khgl_db_totle: 0,

khgl_lc_totle: 0

} },

template: '\\\

\\\待辦事項

\ \\\

\\\流程發起

\ \\\

\\\事項檢視

\ \\\

',methods: ,

mounted() else if(location.href.indexof("/customer/") != -1)

}});

② 審批模組:

props: ["id"],

data()

}, 審批意見

③ 流程狀態:

// flow state log

vue.component("statelog",

}, template: '\\\

}. }

\ \

操作人:}

\ 狀態:}

\ 操作耗時:}

html頁面中呼叫common.js的過濾器:

第一聯絡人:}

支援部門:}

react webpack專案實際開發應用

1.知其然不知其所以然,你只會了jsx語法,卻只能照貓畫虎,卻不知道react背後的基礎知識,如果你連jsx最後會編譯成js都不知道,或者編譯成的js都讀不懂,那更不用談靈活擴充套件和開發了。2.乙個專案要想開發出來僅僅需要只知道react還需要知道很多知識,比如現在很多教程和專案都是webpack...

Django實際開發

建立虛擬環境 python m venv 虛擬環境名 啟用虛擬環境 虛擬環境名 scripts activate 安裝django 解決安裝超時的方法 2 pip default timeout 延長的時間 install 4.利用django建立專案 django admin startobjec...

Django實際站點專案開發經驗談

開發了兩個月的django站點正式上線了,看著 從無到有,從前端到後台,從本地開發到環境部署,一點一滴的堆砌成型,著實帶給我不小的樂趣。django站點介紹 開發環境 阿里雲伺服器centos6.5 nginx1.7 版本 django1.8 python3.4 這是乙個集合訂閱內容 個人部落格的d...