Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hyy1115/style-vw-loader

一个可以将vue标签内样式px转换vw的 webpack loader
https://github.com/hyy1115/style-vw-loader

px style vue vw webpack-loader

Last synced: 8 days ago
JSON representation

一个可以将vue标签内样式px转换vw的 webpack loader

Awesome Lists containing this project

README

        

# style-vw-loader
一个可以将vue标签内样式px转换vw的 webpack loader

### install

```npm
npm install style-vw-loader --save-dev
```

### Use

vue-cli3

```javascript
{
chainWebpack: (config) => {
config.module
.rule('vue')
.test(/\.vue$/)
.use('style-vw-loader')
.loader('style-vw-loader')
}
}
```

vue-cli2

```text
{
test: /\.(vue|jsx?)$/,
loader: 'style-vw-loader',
options: {

}
}
```

### Example

```html
from

Test


```

To

```html

Test


```

### option
默认配置
```javascript
defaultsProp = {
unitToConvert: 'px',
viewportWidth: 750,
unitPrecision: 5,
viewportUnit: 'vw',
fontViewportUnit: 'vw',
minPixelValue: 1
}
```

### 参与

只支持vue模板的转换,react模板未提供支持。如果你也有转换style的需求、欢迎参与完善该项目。