uni-app 之 安裝uView,安裝scss/sass編譯
image.png
image.png
image.png
點擊HBuilder X 頂部,工具,插件安裝,安裝新插件
image.png
image.png
安裝成功!
注意,一定要先登錄才可以安裝
image.png
1. 引入uView主JS庫
在項目根目錄中的main.js
中,引入并使用uView的JS庫,注意這兩行要放在import Vue
之后。
// main.js
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
image.png
#2. 在引入uView的全局SCSS主題文件
在項目根目錄的uni.scss
中引入此文件。
/* uni.scss */
@import '@/uni_modules/uview-ui/theme.scss';
image.png
#3. 引入uView基礎(chǔ)樣式
注意!
在App.vue
中首行的位置引入,注意給style標簽加入lang="scss"屬性
<style lang="scss">
/* 注意要寫在第一行,同時給style標簽加入lang="scss"屬性 */
@import "@/uni_modules/uview-ui/index.scss";
</style>
image.png
然后就可以正常使用啦~文章來源:http://www.zghlxwxcb.cn/news/detail-694634.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-694634.html
到了這里,關(guān)于uni-app 之 安裝uView,安裝scss/sass編譯的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!