記錄 mpvue+pug+stylus+iview weapp

# 全局安裝 vue-cli

$ npm install --global vue-cli

# 創(chuàng)建一個基于 mpvue-quickstart 模板的新項目

$ vue init mpvue/mpvue-quickstart my-project

# 安裝依賴

$ cd my-project

$ npm install

配置pug? ? ? ?//?????? build/webpack.base.config

npminstallpug pug-loader pug-filters --save

rules?? ?{

?? ??? ??? ??? ?test:/\.pug$/,

?? ??? ??? ??? ?loader:'vue-html!pug-html'

?? ??? ??? ?},

配置stylus??????? //?????? build/webpack.base.config

npminstallstyle-loader stylus stylus-loader --save

npminstallextract-text-webpack-plugin --save

rules? ?{

?? ??? ??? ??? ?test:/\.styl/,

?? ??? ??? ??? ?loader: ExtractTextPlugin.extract("css-loader!stylus-loader")

?? ??? ???}

plugins??

?? ??? ??? ?newExtractTextPlugin('css/style.css'),

vscode?配置快速模板

1、文件 ==> 首選項 ==> 用戶代碼片段 ==> 輸入? vue然后回車

{

"Print to console": {

"prefix":"vv",//自己隨便定義快捷鍵

"body": [

"<template lang=\"pug\">",

" div.wrapper",

"</template>\n",

"<script>",

"import Vue from 'vue'",

"export default Vue.extend({",

" components: {\n",

" },",

" data () {",

" return {\n",

" }",

" }",

"})",

"</script>\n",

"<style scoped lang=\"stylus\">",

"</style>",

"",

],

"description":"Log output to console"

}

}

下載?? https://github.com/TalkingData/iview-weapp 解壓 dist目錄導入? 頁面內(nèi)使用

npm run dev

ok!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容