{"id":19714407,"url":"https://github.com/peternaydenov/visual-controller-for-vue","last_synced_at":"2026-06-03T23:31:10.927Z","repository":{"id":79800683,"uuid":"309996843","full_name":"PeterNaydenov/visual-controller-for-vue","owner":"PeterNaydenov","description":"Single js app controls many vue apps.","archived":false,"fork":false,"pushed_at":"2026-04-20T16:54:06.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-20T18:44:10.668Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PeterNaydenov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-04T12:31:14.000Z","updated_at":"2026-04-20T16:55:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"22e911f3-5176-4c42-8fa8-5d271ad7c168","html_url":"https://github.com/PeterNaydenov/visual-controller-for-vue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PeterNaydenov/visual-controller-for-vue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fvisual-controller-for-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fvisual-controller-for-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fvisual-controller-for-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fvisual-controller-for-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterNaydenov","download_url":"https://codeload.github.com/PeterNaydenov/visual-controller-for-vue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterNaydenov%2Fvisual-controller-for-vue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33884733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"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":[],"created_at":"2024-11-11T22:31:31.637Z","updated_at":"2026-06-03T23:31:10.920Z","avatar_url":"https://github.com/PeterNaydenov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visual Controller for Vue (@peter.naydenov/visual-controller-for-vue)\n\n[![version](https://img.shields.io/github/package-json/v/PeterNaydenov/visual-controller-for-vue)](https://github.com/PeterNaydenov/visual-controller-for-vue) [![license](https://img.shields.io/github/license/PeterNaydenov/visual-controller-for-vue)](https://github.com/PeterNaydenov/visual-controller-for-vue)\n\n*Works with Vue 1 and 2.*\nHere is the library for [Vue 3](https://github.com/PeterNaydenov/visual-controller-for-vue3).\n\nTool for building a micro-frontends(MFE) based on Vue components  - Start multiple Vue applications in the same HTML page and control them.\n\nInstall visual controller:\n```\nnpm i @peter.naydenov/visual-controller-for-vue\n```\n\nInitialization process:\n\n```js\nimport Vue from 'vue'\nimport VisualController from '@peter.naydenov/visual-controller-for-vue'\n\nlet \n      eBus = new Vue ()\n    , dependencies = { eBus }  // Provide everything that should be exposed to components \n    , html = new VisualController ({ ...dependencies, Vue })\n    ;\n// Ready for use...\n```\n\nLet's show something on the screen:\n\n```js\n// Let's have vue component 'Hello' with prop 'greeting'\n\nhtml.publish ( Hello, {greeting:'Hi'}, 'app' )\n//arguments are: ( component, props, containerID )\n```\n\n## Inside of the Components\n\n*Note: If your component should be displayed only, that section can be skipped.*\n\nAll provided libraries during visualController initialization are available through `props.dependencies`. Use `props.setupUpdates` if you need to manipulate component from outside.\n\n```js\n// Vue component using Options API\nexport default {\n    props: ['dependencies', 'data', 'setupUpdates', 'containerID', 'eBus']\n  , data () {\n      return {\n          message: this.data.greeting || 'Hello'\n        }\n    }\n  , created () {\n        this.setupUpdates ({\n            changeMessage (update) {\n                this.message = update\n            }\n        })\n    }\n  , template: `\u003cdiv\u003e{{ message }}\u003c/div\u003e`\n}\n```\n\nThe external call will look like this:\n\n```js\nhtml.getApp ( 'app' ).changeMessage ( 'New message content' )\n```\n\n## Visual Controller Methods\n\n```js\n  publish : 'Render Vue app in container. Associate app instance with the container.'\n, getApp  : 'Returns app instance by container name'\n, destroy : 'Destroy app by using container name '\n, has     : 'Checks if app with specific \"id\" was published'\n```\n\n### VisualController.publish ()\n\nPublish a Vue app.\n\n```js\nhtml.publish ( component, props, containerID )\n```\n\n- **component**: *object*. Vue component\n- **props**: *object*. Vue components props\n- **containerID**: *string*. Id of the container where Vue-app will live.\n- **returns**: *Promise. Update methods library if defined. Else will return an empty object;\n\nExample:\n\n```js\nlet html = new VisualController ({ eBus, Vue })\nhtml.publish ( Hi, { greeting: 'hi'}, 'app' )\n```\n\nRender component 'Hi' with prop 'greeting' and render it in html element with id \"app\".\n\n### VisualController.getApp ()\n\nReturns the library of functions provided from method `setupUpdates`. If Vue-app never called `setupUpdates`, result will be an empty object.\n\n```js\nlet controls = html.getApp ( containerID )\n```\n\n- **containerID**: *string*. Id of the container.\n\nExample:\n\n```js\nlet \n      id = 'videoControls'\n    , controls = html.getApp ( id )\n    ;\n    // if app with 'id' doesn't exist -\u003e returns false, \n    // if app exists and 'setupUpdates' was not used -\u003e returns {}\n    // in our case -\u003e returns { changeMessage:f }\nif ( !controls )   console.error ( `App with id:\"${id}\" is not available` )\nelse {\n        if ( controls.changeMessage )   controls.changeMessage ('new title') \n   }\n```\n\nIf visual controller(html) has a Vue app associated with this name will return it. Otherwise will return **false**.\n\n### VisualController.has ()\n\nChecks if app with specific \"id\" was published.\n\n```js\nconst has = html.has ( containerID )\n```\n\n- **containerID**: *string*. Id of the container.\n- **returns**: *boolean*. Returns true if app with specific id exists, false otherwise\n\n### VisualController.destroy ()\n\nWill destroy Vue app associated with this container name and container will become empty. Function will return 'true' on success and 'false' on failure. Function will not delete content of provided container if there is no Vue app associated with it.\n\n```js\nhtml.destroy ( containerID )\n```\n\n- **containerID**: *string*. Id name.\n\n### Extra\n\nVisual Controller has versions for few other front-end frameworks:\n- [Vue 3](https://github.com/PeterNaydenov/visual-controller-for-vue3)\n- [React](https://github.com/PeterNaydenov/visual-controller-for-react)\n- [Svelte 5](https://github.com/PeterNaydenov/visual-controller-for-svelte5)\n- [Solid](https://github.com/PeterNaydenov/visual-controller-for-solid)\n- [Preact](https://github.com/PeterNaydenov/visual-controller-for-preact)\n- [Lit](https://github.com/PeterNaydenov/visual-controller-for-lit)\n- [Svelte 3 and 4](https://github.com/PeterNaydenov/visual-controller-for-svelte3)\n\n\n\n## Links\n- [License](https://github.com/PeterNaydenov/visual-controller-for-vue/blob/master/LICENSE)\n\n## Credits\n\n'visual-controller-for-vue' is created and supported by Peter Naydenov\n\n## License\n\n'visual-controller-for-vue' is released under the [MIT license](https://github.com/PeterNaydenov/visual-controller-for-vue/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeternaydenov%2Fvisual-controller-for-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeternaydenov%2Fvisual-controller-for-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeternaydenov%2Fvisual-controller-for-vue/lists"}