{"id":17194521,"url":"https://github.com/matteogabriele/vue-component-observer","last_synced_at":"2025-04-13T20:14:06.461Z","repository":{"id":35011503,"uuid":"195801564","full_name":"MatteoGabriele/vue-component-observer","owner":"MatteoGabriele","description":"Plugin for responsive components","archived":true,"fork":false,"pushed_at":"2023-10-07T06:13:26.000Z","size":100,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-13T20:14:04.816Z","etag":null,"topics":["breakpoints","eqcss","responsive-design","vue"],"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/MatteoGabriele.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-08T11:49:30.000Z","updated_at":"2024-06-26T22:18:25.000Z","dependencies_parsed_at":"2024-10-15T01:47:19.878Z","dependency_job_id":"cdf8b9bb-44f3-4fbe-b773-22127eb5d050","html_url":"https://github.com/MatteoGabriele/vue-component-observer","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/MatteoGabriele%2Fvue-component-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoGabriele%2Fvue-component-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoGabriele%2Fvue-component-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoGabriele%2Fvue-component-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatteoGabriele","download_url":"https://codeload.github.com/MatteoGabriele/vue-component-observer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248774969,"owners_count":21159534,"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":["breakpoints","eqcss","responsive-design","vue"],"created_at":"2024-10-15T01:47:16.534Z","updated_at":"2025-04-13T20:14:06.415Z","avatar_url":"https://github.com/MatteoGabriele.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-component-observer\n\nPlugin for responsive components\n\n### Installation\n\n```bash\nyarn add vue-component-observer\n```\n\n### Usage\n\n```js\nimport VueComponentObserver from \"vue-component-observer\";\n\nVue.use(VueComponentObserver);\n```\n\nDeclare the component breakpoints in the root of the component itself and then use the `$eq` property to render these computations.\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cp v-if=\"$eq.medium\"\u003emedium\u003c/p\u003e\n    \u003cp v-else\u003esmall\u003c/p\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nexport default {\n  name: \"MyComponent\",\n  \n  breakpoints: {\n    medium: {\n      minWidth: 600,\n    },\n    large: {\n      minWidth: 1200,\n    },\n  },\n};\n\u003c/script\u003e\n```\n\n### Use Observer component\n\nUse the built-in Observer component\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cObserver :breakpoints=\"breakpoints\" v-slot=\"{ eq }\"\u003e\n      \u003cp v-if=\"eq.medium\"\u003emedium\u003c/p\u003e\n      \u003cp v-else\u003esmall\u003c/p\u003e\n    \u003c/Observer\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript setup\u003e\nconst breakpoints = {\n  medium: {\n    minWidth: 600,\n  },\n};\n\u003c/script\u003e\n```\n\n### Props list\n\n#### tag\nWhat tag the Observer component should render\n\ndefault: 'div'\n\n#### slim\nRender or not a node element\n\ndefault: false\n\n\n#### breakpoints\nObserver breakpoints. Supports: minWidth, maxWidth, minHeight and maxHeight \n\ndefault: null\n\n\n### Local usage\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cObserver :breakpoints=\"breakpoints\" v-slot=\"{ eq }\"\u003e\n      \u003cp v-if=\"eq.medium\"\u003emedium\u003c/p\u003e\n      \u003cp v-else\u003esmall\u003c/p\u003e\n    \u003c/Observer\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript setup\u003e\nimport { Observer } from \"vue-component-observer\";\n\nconst breakpoints = {\n  medium: {\n    minWidth: 600,\n  },\n};\n\u003c/script\u003e\n```\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cp v-if=\"$eq.medium\"\u003emedium\u003c/p\u003e\n    \u003cp v-else\u003esmall\u003c/p\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport { ObserverMixin } from \"vue-component-observer\";\n\nexport default {\n  name: \"MyComponent\",\n\n  mixins: [ObserverMixin],\n\n  breakpoints: {\n    medium: {\n      minWidth: 600,\n    },\n    large: {\n      minWidth: 1200,\n    },\n  },\n};\n\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteogabriele%2Fvue-component-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatteogabriele%2Fvue-component-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatteogabriele%2Fvue-component-observer/lists"}