{"id":15294907,"url":"https://github.com/realdah/vue-blockui","last_synced_at":"2026-06-28T15:30:17.118Z","repository":{"id":57394723,"uuid":"100292498","full_name":"realdah/vue-blockui","owner":"realdah","description":"BlockUI for vue 2, similiar to jquery blockUI, can be used for loading screen.","archived":false,"fork":false,"pushed_at":"2018-05-15T01:23:50.000Z","size":258,"stargazers_count":58,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-23T23:02:21.969Z","etag":null,"topics":[],"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/realdah.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":"2017-08-14T17:26:27.000Z","updated_at":"2023-12-10T06:40:56.000Z","dependencies_parsed_at":"2022-09-06T04:00:55.411Z","dependency_job_id":null,"html_url":"https://github.com/realdah/vue-blockui","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realdah%2Fvue-blockui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realdah%2Fvue-blockui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realdah%2Fvue-blockui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/realdah%2Fvue-blockui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/realdah","download_url":"https://codeload.github.com/realdah/vue-blockui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240093142,"owners_count":19746774,"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":[],"created_at":"2024-09-30T17:07:51.200Z","updated_at":"2026-06-28T15:30:17.062Z","avatar_url":"https://github.com/realdah.png","language":"JavaScript","funding_links":[],"categories":["UI组件","Components \u0026 Libraries","UI Components [🔝](#readme)","UI Components"],"sub_categories":["装载机","UI Components","Loader"],"readme":"# vue-blockui\n\n[![npm](https://img.shields.io/npm/v/vue-blockui.svg) ![npm](https://img.shields.io/npm/dm/vue-blockui.svg)](https://www.npmjs.com/package/vue-blockui)\n[![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)\n\nBlockUI for vue 2, similiar to jquery blockUI, can be used for loading screen.\n\n## Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Demo Screens](#demo-screens)\n\n# Installation\n\n```\nnpm install --save vue-blockui\n```\n\n## Use Component\n\nInstall all the components:\n\n```javascript\nimport Vue from 'vue'\nimport BlockUI from 'vue-blockui'\n\nVue.use(BlockUI)\n```\n\n\n**\n⚠️ If You see some errors during webpack compilation, you might be missing the right configuration for loading css in your \u003cb\u003ewebpack.config.js\u003c/b\u003e.\n**\n\nUnder \"rules\", you should have below configuration: \n```\n    {\n        test: /\\.css$/,\n        use: [ 'style-loader', 'css-loader' ]\n    }\n```\n\n* Be aware that you should have configured style-loader and css-loader in your package.json to support above rule.\n\n```\nnpm install style-loader css-loader --save-dev    \n```\n\n\n**⚠️ You might need to configure your bundler to support `.vue` files.** More info [in the official documentation](https://vuejs.org/v2/guide/single-file-components.html).\n\nI would recommend you to create your VUE project using vue-cli, then it should included vue-loader in webpack by default.\n\n# Usage\n\n| Prop Name  | Description |\n| ------------- | ------------- |\n| message  | Message to be shown in loading screen  |\n| url  | \u003cb\u003eOptional Field\u003c/b\u003e, image including svg/gif/png/jpg etc, you can use any animated/static image supported by img tag.  Please be aware that you'd better import the image resource then use it instead of directly using relative image path. Example can be found in this document. If \u003cb\u003eurl\u003c/b\u003e attribute presents and not empty, it will ignore \u003cb\u003ehtml\u003c/b\u003e attribute|\n| html | (Deprecated, suggest to use [slot] option instead), \u003cb\u003eOptional Field\u003c/b\u003e, you can insert html template to icon area, this enables you to utilize external animated fonts/css libaries. eg. [fontawesome](http://fontawesome.io/examples/) or [Spinkit](https://github.com/tobiasahlin/SpinKit) etc.  \u003cb\u003eDon't forget to import related css \u0026 fonts into project by yourself\u003c/b\u003e\n| [slot] | Directly use any html template or other Vue Component, it will replace the icon part, see examples in readme.\n\nThen, you can combine with \u003cb\u003ev-if\u003c/b\u003e/\u003cb\u003ev-show\u003c/b\u003e to show or hide the BlockUI.\n\n\n## In your Code\nPlease be aware, if you are using webpack and with file-loader to add finger print to your asserts,\nYou can not add relative image resouce path directly in BlockUI component.\nPlease use import to get the image, then pass it to the directive.\n```\nimport Vue from 'vue'\nimport BlockUI from 'vue-blockui'\nimport loadingImage from './assets/logo.png'\n\nVue.use(BlockUI)\n```\n```\n\u003cBlockUI :message=\"msg\" :url=\"url\"\u003e\u003c/BlockUI\u003e\n\nexport default {\n  name: 'app',\n  data () {\n    return {\n      msg: 'Welcome to Your Vue.js App',\n      url : loadingImage   //It is important to import the loading image then use here\n    }\n  }\n}\n```\nor\n```\n\u003cBlockUI :message=\"msg\" :html=\"html\"\u003e\u003c/BlockUI\u003e\n\nexport default {\n  name: 'app',\n  data () {\n    return {\n      msg: 'Welcome to Your Vue.js App',\n      html: '\u003ci class=\"fa fa-cog fa-spin fa-3x fa-fw\"\u003e\u003c/i\u003e',  //this line demostrate how to use fontawesome animation icon \n    }\n  }\n}\n```\n\nOr using inline html or component **[slot example]**\n```\n\u003cBlockUI :message=\"msg\"\u003e\n  \u003ci class=\"fa fa-cog fa-spin fa-3x fa-fw\"\u003e\u003c/i\u003e\n\u003c/BlockUI\u003e\n\nexport default {\n  name: 'app',\n  data () {\n    return {\n      msg: 'Welcome to Your Vue.js App',\n    }\n  }\n}\n```\n\n## Styling Customization\nYou can override BlockUI sytlings based on your needs.\nCheck the class defined for BlockUI using develop tool in your favorite browser for more details.\n\nThe layout hierarchy desmostrated in below, I did not use simple class like \"label\" due to the risk of being polluted by other external css.\n```\n.loading-container {\n  .loading-backdrop {\n    //the backdrop falls in here, you can override the opacity etc.\n  }\n  .loading {\n    .loading-icon {\n      //the image or inserted html will be put here\n    }\n    .loading-label {\n      //the label showing on loading screen\n    }\n  }\n}\n\n```\n\n# Demo Screens\nCheck below screenshots (More to come):\n\nBelow screen is using animated gif/svg\n![Sample used animated gif/svg](https://raw.githubusercontent.com/realdah/vue-blockui/master/samples/sample1.jpg)\n\nBelow screen is using font awesome css animation\n![Sample used css animation](https://raw.githubusercontent.com/realdah/vue-blockui/master/samples/sample2.png)\n\nBelow screen is using spinkit css animation\n![Sample used css animation](https://raw.githubusercontent.com/realdah/vue-blockui/master/samples/sample3.png)\n\nSample config for using spinkit css animation:\n```\n\u003cBlockUI :message=\"msg\"\u003e\n  \u003cdiv class=\"sk-wave\"\u003e\n    \u003cdiv class=\"sk-rect sk-rect1\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"sk-rect sk-rect2\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"sk-rect sk-rect3\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"sk-rect sk-rect4\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"sk-rect sk-rect5\"\u003e\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/BlockUI\u003e\n\nexport default {\n  name: 'HelloWorld',\n  data () {\n    return {\n      msg: 'Welcome to Your Vue.js App',\n    }\n  }\n}\n```\n\n\n# Plugin Development\n\n## Installation\n\nThe first time you create or clone your plugin, you need to install the default dependencies:\n\n```\nnpm install\n```\n\n## Watch and compile\n\nThis will run webpack in watching mode and output the compiled files in the `dist` folder.\n\n```\nnpm run dev\n```\n\n## Use it in another project\n\nWhile developping, you can follow the install instructions of your plugin and link it into the project that uses it.\n\nIn the plugin folder:\n\n```\nnpm link\n```\n\nIn the other project folder:\n\n```\nnpm link vue-blockui\n```\n\nThis will install it in the dependencies as a symlink, so that it gets any modifications made to the plugin.\n\n## Publish to npm\n\nYou may have to login to npm before, with `npm adduser`. The plugin will be built in production mode before getting published on npm.\n\n```\nnpm publish\n```\n\n## Manual build\n\nThis will build the plugin into the `dist` folder in production mode.\n\n```\nnpm run build\n```\n\n---\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealdah%2Fvue-blockui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frealdah%2Fvue-blockui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frealdah%2Fvue-blockui/lists"}