{"id":19204520,"url":"https://github.com/hyy1115/style-vw-loader","last_synced_at":"2025-05-12T15:46:17.760Z","repository":{"id":57373240,"uuid":"148462941","full_name":"hyy1115/style-vw-loader","owner":"hyy1115","description":"一个可以将vue标签内样式px转换vw的 webpack loader","archived":false,"fork":false,"pushed_at":"2019-01-21T06:00:13.000Z","size":5,"stargazers_count":64,"open_issues_count":8,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T09:42:16.233Z","etag":null,"topics":["px","style","vue","vw","webpack-loader"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyy1115.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-12T10:28:16.000Z","updated_at":"2025-02-21T20:13:58.000Z","dependencies_parsed_at":"2022-08-30T00:40:42.336Z","dependency_job_id":null,"html_url":"https://github.com/hyy1115/style-vw-loader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyy1115%2Fstyle-vw-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyy1115%2Fstyle-vw-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyy1115%2Fstyle-vw-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyy1115%2Fstyle-vw-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyy1115","download_url":"https://codeload.github.com/hyy1115/style-vw-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253767716,"owners_count":21961163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["px","style","vue","vw","webpack-loader"],"created_at":"2024-11-09T13:08:31.241Z","updated_at":"2025-05-12T15:46:17.735Z","avatar_url":"https://github.com/hyy1115.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# style-vw-loader\n一个可以将vue标签内样式px转换vw的 webpack loader\n\n\n### install\n\n```npm\nnpm install style-vw-loader --save-dev\n```\n\n### Use\n\nvue-cli3\n\n```javascript\n{\n  chainWebpack: (config) =\u003e {\n      config.module\n      .rule('vue')\n      .test(/\\.vue$/)\n      .use('style-vw-loader')\n        .loader('style-vw-loader')\n    }\n}\n```\n\nvue-cli2 \n\n```text\n{\n    test: /\\.(vue|jsx?)$/,\n    loader: 'style-vw-loader',\n    options: {\n       \n    }\n}\n```\n\n### Example\n\n```html\nfrom\n\n\u003ch3 style=\"font-size: 28px;margin-top: 10px\" width=\"500px\"\u003eTest\u003c/h3\u003e\n```\n\nTo\n\n```html\n\u003ch3 width=\"66.66667vw\" style=\"font-size: 3.73333vw; margin-top: 1.33333vw;\"\u003eTest\u003c/h3\u003e\n```\n\n### option\n默认配置\n```javascript\ndefaultsProp = {\n  unitToConvert: 'px',\n  viewportWidth: 750,\n  unitPrecision: 5,\n  viewportUnit: 'vw',\n  fontViewportUnit: 'vw',\n  minPixelValue: 1\n}\n```\n\n### 参与\n\n只支持vue模板的转换，react模板未提供支持。如果你也有转换style的需求、欢迎参与完善该项目。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyy1115%2Fstyle-vw-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyy1115%2Fstyle-vw-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyy1115%2Fstyle-vw-loader/lists"}