准备
npm init
安装vuenpm i vue
安装parcelnpm install -g parcel-bundler
开发者使用的包 -D
安装后运行parcel
,parcel会自动安装所有依赖
vue pacel 配置
Parcel
在你项目的 package.json 中添加:
{
// …
“alias”: {
“vue” : “./node_modules/vue/dist/vue.common.js”
}
}
编译
parcel index.html --no-cache
1.css使用变量
:root{
--button-bg:red;
}
使用
.g-button{
background:var(--button-bg)
}