最近用Taro+Vantui從0-1開(kāi)發(fā)向程序的項(xiàng)目,以下是我總結(jié)我在項(xiàng)目中遇到的問(wèn)題
-
如何搭建一個(gè)項(xiàng)目,可以參開(kāi)vantUI首頁(yè)引導(dǎo)進(jìn)行配置鏈接如下:
https://antmjs.github.io/vantui/main/#/quickstart
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-547192.html -
樣式配置,
2.1 項(xiàng)目目錄 config->index.js
2.2.mini->webpackChain
代碼如下文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-547192.htmlmini: { enableExtract: true, webpackChain(chain) { chain.merge({...chainConfig}); } } //chainConfig代碼如下 const chainConfig={ module: { rule: { themeLoader: { test: /\.less$/, use:[ { loader: "less-loader", options: { lessOptions: { modifyVars: { // 直接覆蓋變量 "text-color": "#111", "border-color": "#eee", green: "#00c8c8", "button-normal-border-radius": "50px", "tag-primary-color": "#00c8c8", "tag-border-radius": "50px", "tag-padding": "4px 16px", // 'primary-color': 'red', // 或者可以通過(guò) less 文件覆蓋(文件路徑為絕對(duì)路徑) // hack: `true; @import "your-less-file-path.less";`, }, }, }, }, ] } } } }
到了這里,關(guān)于Taro+Vantui項(xiàng)目公共樣式配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!