Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hyy1115/style-vw-loader
- Owner: hyy1115
- License: mit
- Created: 2018-09-12T10:28:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T06:00:13.000Z (almost 6 years ago)
- Last Synced: 2024-10-04T12:17:57.307Z (about 1 month ago)
- Topics: px, style, vue, vw, webpack-loader
- Language: JavaScript
- Size: 4.88 KB
- Stars: 63
- Watchers: 5
- Forks: 16
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
fromTest
```To
```html
Test
```### option
默认配置
```javascript
defaultsProp = {
unitToConvert: 'px',
viewportWidth: 750,
unitPrecision: 5,
viewportUnit: 'vw',
fontViewportUnit: 'vw',
minPixelValue: 1
}
```### 参与
只支持vue模板的转换,react模板未提供支持。如果你也有转换style的需求、欢迎参与完善该项目。