{"id":15067474,"url":"https://github.com/knowscount/vue-selection-share","last_synced_at":"2025-04-10T14:22:35.551Z","repository":{"id":50223582,"uuid":"372763769","full_name":"KnowsCount/vue-selection-share","owner":"KnowsCount","description":"📄 a medium-like text highlight sharing component","archived":false,"fork":false,"pushed_at":"2021-06-11T11:00:55.000Z","size":174,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T16:08:15.756Z","etag":null,"topics":["component","medium","share","text-highlight","vue","vue2"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vue-selection-share","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KnowsCount.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":"2021-06-01T08:53:53.000Z","updated_at":"2025-02-25T18:02:25.000Z","dependencies_parsed_at":"2022-08-27T19:41:56.133Z","dependency_job_id":null,"html_url":"https://github.com/KnowsCount/vue-selection-share","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnowsCount%2Fvue-selection-share","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnowsCount%2Fvue-selection-share/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnowsCount%2Fvue-selection-share/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnowsCount%2Fvue-selection-share/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnowsCount","download_url":"https://codeload.github.com/KnowsCount/vue-selection-share/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248233936,"owners_count":21069493,"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":["component","medium","share","text-highlight","vue","vue2"],"created_at":"2024-09-25T01:24:19.943Z","updated_at":"2025-04-10T14:22:35.536Z","avatar_url":"https://github.com/KnowsCount.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n * @Date: 01/06/2021 21.20.26 +0800\n * @Author: KnowsCount\n * @LastEditTime: 10/06/2021 07.41.14 +0800\n * @FilePath: /vue-selection-share/README.md\n--\u003e\n\n# vue-selection-share\n\n\u003e a medium-like text highlight sharing component with zero dependencies.\n\nto learn how I created this, click [this](https://juejin.cn/post/6970687166145904654) to read a chinese tutorial.\n\n![](https://knowscount-1304485449.cos.ap-shanghai.myqcloud.com/img/Screenshot%202021-06-01%20at%2021.21.11.png)\n\nwell, it's all about reinventing the wheel.\n\n---\n\n## 🤤 usage\n\nto install the single file component, run:\n\n```\nnpm install --save vue-selection-share\n```\n\nto use the component:\n\n\u003c!-- prettier-ignore-start --\u003e\n```vue.js\nimport VueSelectionShare from 'vue-selection-share';\nVue.use(VueSelectionShare)\n```\n\u003c!-- prettier-ignore-end --\u003e\n\nthen add the component outside of the elements that needs the popover, and the clicking behaviours:\n\n\u003c!-- prettier-ignore-start --\u003e\n```vue.js\n\u003cVueSelectionShare @share=\"onShare\" @highlight=\"onHighlight\"\u003e\n    \u003cp\u003emother of god\u003c/p\u003e\n\u003c/VueSelectionShare\u003e\n```\n\u003c!-- prettier-ignore-end --\u003e\n\nlastly add the `methods`, to `onShare` and `onHighlight`:\n\n\u003c!-- prettier-ignore-start --\u003e\n```vue.js\nmethods: {\n    onShare (text) {\n        console.log('share:', text)\n    },\n\n    onHighlight (text) {\n        console.log('highlight:', text)\n    }\n}\n```\n\u003c!-- prettier-ignore-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowscount%2Fvue-selection-share","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknowscount%2Fvue-selection-share","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknowscount%2Fvue-selection-share/lists"}