{"id":13789278,"url":"https://github.com/jardenliu/wepy-plugin-iview","last_synced_at":"2025-07-30T05:32:51.725Z","repository":{"id":57397644,"uuid":"144041913","full_name":"jardenliu/wepy-plugin-iview","owner":"jardenliu","description":"A wepy plugin for weapp-iview","archived":false,"fork":false,"pushed_at":"2018-09-01T15:59:00.000Z","size":22,"stargazers_count":29,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-29T19:16:56.091Z","etag":null,"topics":["app","iview","mini","mini-app","plugin","weapp","weapp-iview","wechat","wechat-app","wepy"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jardenliu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-08T16:44:32.000Z","updated_at":"2024-04-24T14:03:43.000Z","dependencies_parsed_at":"2022-08-31T15:10:22.700Z","dependency_job_id":null,"html_url":"https://github.com/jardenliu/wepy-plugin-iview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jardenliu/wepy-plugin-iview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jardenliu%2Fwepy-plugin-iview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jardenliu%2Fwepy-plugin-iview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jardenliu%2Fwepy-plugin-iview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jardenliu%2Fwepy-plugin-iview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jardenliu","download_url":"https://codeload.github.com/jardenliu/wepy-plugin-iview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jardenliu%2Fwepy-plugin-iview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267815187,"owners_count":24148356,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["app","iview","mini","mini-app","plugin","weapp","weapp-iview","wechat","wechat-app","wepy"],"created_at":"2024-08-03T21:01:01.014Z","updated_at":"2025-07-30T05:32:51.691Z","avatar_url":"https://github.com/jardenliu.png","language":"JavaScript","funding_links":[],"categories":["微信小程序WePY框架开发资源汇总 ![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)"],"sub_categories":["WePY开源组件"],"readme":"# wepy-plugin-iview\r\n\u003e 一个iView的wepy插件\r\n\r\n## 特性\r\n* 自动注入\r\n* 简易配置\r\n* px转换(rpx, rem, em, px)\r\n\r\n## 用法\r\n1. 安装`iview-app`\r\n```bash\r\n  $ npm i iview-weapp -S\r\n```\r\n2. 安装`wepy-plugin-iview`\r\n```bash\r\n  $ npm i wepy-plugin-iview\r\n```\r\n3. 在`wepy.config.js`中`plugins`项中添加 `iview:{}`\r\n```javascript\r\n  plugins: {\r\n    // ...\r\n    iview: {\r\n    }\r\n    // ...\r\n  }\r\n```\r\n4. 运行项目，即可使用iView的全部组件啦~~   如:`\u003ci-button\u003e\u003c/i-button\u003e`\r\n\r\n5. `$toast`、`$Message`的引入\r\n```javascript\r\n    import {$Toast, $Message} from 'wepy-iview'\r\n```\r\n\r\n## 全局注入配置\r\n\r\n默认是在`pages`目录下的所有页面的`usingComponents`中，自动注入全部iview的组件。\r\n```javascript\r\n  iview: {\r\n      pagePath: 'pages',\r\n      // 可选，默认为 pages。如果页面目录不为pages，或有多个目录, 通过此值设置。\r\n      // 参考配置：\r\n      // pagePath: 'page2'                         page2为页面有目录\r\n      // pagePath:['page1','page2',...]            多页面目录\r\n         \r\n      config: {\r\n        inject: true,\r\n        // 可选，默认为 true, 注入iView的全部组件。 如果不想全部, 通过此值设置。\r\n        // 参考配置：\r\n        // inject: false                           不注入任何组件 \r\n        // inject:['button','icon',...]            只注入部分组件\r\n                \r\n        prefix: 'i-',\r\n        // 可选，默认为 'i-', 组件名前缀。 如果使用其他组件名前缀, 通过此值设置。\r\n        // 参考配置：\r\n        // prefix: 'a-'                            button的组件名为'a-button'\r\n\r\n        px2: false  \r\n        // 可选，默认为false, 开启px单位转换。 可选值 true, false, config object {...}\r\n       // 参考配置：\r\n       // px2: true\r\n       // px2: {}\r\n\r\n      //  px2: {\r\n      //       relative: 400,          // 相对值,rpx是 相对于750宽度 ；  rem，em 是相对的 font-size\r\n      //       decimalPlaces: 2,       //  保留的小数位数\r\n      //       targetUnits: 'rpx'      // 目标转换的单位 支持 rpx rem em px\r\n      //   }\r\n      }\r\n    }\r\n```\r\n\r\n## 页面注入配置\r\n\r\n很多情况下，不希望注入太多的组件。可以通过全局配置的`inject:false`或`inject:['button','icon',...]`来实现。\r\n但是某些特殊的页面又需要一些特殊的组件。可以通过下面的方式设置。\r\n\r\n1. 在页面的config中添加 `iView: ['button', 'card']`,即可快速注入。该配置在当前页面，权重高于全局的inject设置\r\n```javascript\r\n  config = {\r\n    iView: ['button', 'card']\r\n  }\r\n\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjardenliu%2Fwepy-plugin-iview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjardenliu%2Fwepy-plugin-iview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjardenliu%2Fwepy-plugin-iview/lists"}