{"id":13938084,"url":"https://github.com/fritx/vue-at","last_synced_at":"2025-05-15T22:04:54.473Z","repository":{"id":41534503,"uuid":"76672560","full_name":"fritx/vue-at","owner":"fritx","description":"At.js for Vue.","archived":false,"fork":false,"pushed_at":"2023-06-12T04:03:34.000Z","size":3918,"stargazers_count":532,"open_issues_count":92,"forks_count":115,"subscribers_count":15,"default_branch":"vue2","last_synced_at":"2025-04-27T12:23:28.673Z","etag":null,"topics":["at","atwho","vue"],"latest_commit_sha":null,"homepage":"https://fritx.github.io/vue-at/","language":"Vue","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/fritx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":null,"open_collective":"vue-at","ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2016-12-16T17:29:08.000Z","updated_at":"2025-03-14T14:39:07.000Z","dependencies_parsed_at":"2023-09-29T08:52:17.034Z","dependency_job_id":null,"html_url":"https://github.com/fritx/vue-at","commit_stats":{"total_commits":131,"total_committers":11,"mean_commits":"11.909090909090908","dds":0.1984732824427481,"last_synced_commit":"37777dc4e06ac40c9bf5871d5e258460b59f27ee"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fritx%2Fvue-at","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fritx%2Fvue-at/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fritx%2Fvue-at/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fritx%2Fvue-at/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fritx","download_url":"https://codeload.github.com/fritx/vue-at/tar.gz/refs/heads/vue2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252639421,"owners_count":21780738,"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":["at","atwho","vue"],"created_at":"2024-08-07T23:04:13.827Z","updated_at":"2025-05-15T22:04:54.451Z","avatar_url":"https://github.com/fritx.png","language":"Vue","funding_links":["https://opencollective.com/vue-at"],"categories":["UI Components [🔝](#readme)","Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","Vue","UI组件","Components \u0026 Libraries","UI Components"],"sub_categories":["Libraries \u0026 Plugins","形成","UI Components","Form"],"readme":"# vue-at\n\n\u003ca href=\"https://we-demo.github.io/vue-at-vite-app/\"\u003e\u003cimg width=\"76\" height=\"20\" src=\"https://img.shields.io/website?url=https%3A%2F%2Fwe-demo.github.io%2Fvue-at-vite-app%2F\"\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003ca href=\"https://www.npmjs.com/package/vue-at\"\u003e\u003cimg height=\"20\" src=\"https://img.shields.io/npm/dm/vue-at.svg\"\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003ca href=\"https://github.com/fritx/vue-at\"\u003e\u003cimg width=\"90\" height=\"20\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" /\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003ca href=\"https://github.com/fritx/vue-at\"\u003e\u003cimg width=\"84\" height=\"20\" src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u003ca href=\"https://gitter.im/fritx/vue-at?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\u003cimg width=\"92\" src=\"https://badges.gitter.im/fritx/vue-at.svg\" alt=\"Join the chat at https://gitter.im/fritx/vue-at\"\u003e\u003c/a\u003e\n\n\u003cimg width=\"262\" height=\"218\" src=\"https://raw.githubusercontent.com/fritx/vue-at/master/WechatIMG1.jpeg\"\u003e\u0026nbsp;\u0026nbsp;\u003cimg width=\"262\" height=\"218\" src=\"https://raw.githubusercontent.com/fritx/vue-at/master/WechatIMG2.jpeg\"\u003e\n\n- [x] Chrome / Firefox / Edge / IE9~IE11\n- [x] Plain-text based, no jQuery, no extra nodes\n- [x] Content-Editable / Textarea\n- [x] Avatars, custom templates\n- [x] Vue3 / Vue2 / Vue1\n- [x] Vuetify / Element UI / Element Plus\n- [ ] Vue-CLI migration\n- [ ] Vite migration\n\nPlayground: https://we-demo.github.io/vue-at-vite-app/\u003cbr\u003e\nVue3 Docs: https://github.com/fritx/vue-at/tree/vue3#readme\u003cbr\u003e\nVue2 Docs: https://fritx.github.io/vue-at/ or see below\u003cbr\u003e\nSee also: [react-at](https://github.com/fritx/react-at)\n\n## Motivation\n\n[At.js](https://github.com/ichord/At.js) is awesome, but:\n\n- It is based on jQuery and jQuery-Caret.\n- It introduces extra node wrappers.\n- It could be unstable on content edit/copy/paste.\n\nFinally I ended up creating this.\n\n**If you're using Vue3, read [branch vue3](https://github.com/fritx/vue-at/tree/vue3#readme) instead.**\n\n```plain\nnpm i vue-at@next  # for Vue3 (branch vue3)\nnpm i vue-at@2.x  # for Vue2 (branch vue2)\nnpm i vue-at@1.x  # for Vue1 (branch vue1-legacy)\nnpm i vue1-at  # for Vue1 (branch vue1-new)\n```\n\n```vue\n\u003ctemplate\u003e\n  \u003cat :members=\"members\"\u003e\n    \u003cdiv contenteditable\u003e\u003c/div\u003e\n  \u003c/at\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport At from 'vue-at'\n\nexport default {\n  components: { At },\n  data () {\n    return {\n      members: ['Roxie Miles', 'grace.carroll', '小浩']\n    }\n  }\n}\n\u003c/script\u003e\n\n\u003cstyle\u003e\n#app .atwho-view { /* more */ }\n#app .atwho-ul { /* more */ }\n\u003c/style\u003e\n```\n\n## Using V-Model (Recommended)\n\nWith Content-Editable, `v-model` should be bound in `\u003cat\u003e` container.\u003cbr\u003e\nWith Textarea, `v-model` should be bound in `\u003ctextarea\u003e` itself.\n\n```vue\n\u003cat v-model=\"html\"\u003e\n  \u003cdiv contenteditable\u003e\u003c/div\u003e\n\u003c/at\u003e\n\n\u003cat-ta\u003e\n  \u003ctextarea v-model=\"text\"\u003e\u003c/textarea\u003e\n\u003c/at-ta\u003e\n```\n\n## Textarea\n\n```vue\n\u003ctemplate\u003e\n  \u003cat-ta\u003e\n    \u003ctextarea\u003e\u003c/textarea\u003e\n  \u003c/at-ta\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\n// import At from 'vue-at' // for content-editable\nimport AtTa from 'vue-at/dist/vue-at-textarea' // for textarea\n\nexport default {\n  components: { AtTa }\n}\n\u003c/script\u003e\n```\n\n```plain\nnpm i -S textarea-caret  # also, for textarea\n```\n\n## Custom Templates\n\n### Custom List\n\n```vue\n\u003ctemplate\u003e\n  \u003cat :members=\"members\" name-key=\"name\"\u003e\n    \u003ctemplate slot=\"item\" slot-scope=\"s\"\u003e\n      \u003cimg :src=\"s.item.avatar\"\u003e\n      \u003cspan v-text=\"s.item.name\"\u003e\u003c/span\u003e\n    \u003c/template\u003e\n    \u003cdiv contenteditable\u003e\u003c/div\u003e\n  \u003c/at\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\n// ...\nmembers: [{\n  avatar: 'https://randomuser.me/api/portraits/men/2.jpg',\n  name: 'myrtie.green'\n}, {\n  avatar: 'https://randomuser.me/api/portraits/men/8.jpg',\n  name: '椿木'\n}]\n\u003c/script\u003e\n\n\u003cstyle\u003e\n#app .atwho-li { /* more */ }\n#app .atwho-li img { /* more */ }\n#app .atwho-li span { /* more */ }\n\u003c/style\u003e\n```\n\n#### Custom List with Vue 1.x\n\nThere is no \"scoped slot\" feature in Vue 1.\u003cbr\u003e\nUse a \"normal slot\" with `data-` attribute instead.\n\n```vue\n\u003c!-- vue1-at for vue@1.x --\u003e\n\u003ctemplate slot=\"item\"\u003e\n  \u003cimg data-src=\"item.avatar\"\u003e\n  \u003cspan data-text=\"item.name\"\u003e\u003c/span\u003e\n\u003c/template\u003e\n```\n\n### Custom Tags\n\nThis gives you the option of changing the style of inserted tagged items. It is only supported for ContentEditable version, not Textarea.\n\n```vue\n\u003cspan slot=\"embeddedItem\" slot-scope=\"s\"\u003e\n  \u003cspan class=\"tag\"\u003e\u003cimg :src=\"s.current.avatar\"\u003e{{ s.current.name }}\u003c/span\u003e\n\u003c/span\u003e\n\n\u003c!-- with Vue 2.6+ 'v-slot' directive --\u003e\n\u003c!-- note at least two '\u003cspan\u003e' wrapper are required to work --\u003e\n\u003ctemplate v-slot:embeddedItem=\"s\"\u003e\n  \u003cspan\u003e\u003cspan class=\"tag\"\u003e\u003cimg class=\"avatar\" :src=\"s.current.avatar\"\u003e{{ s.current.name }}\u003c/span\u003e\u003c/span\u003e\n\u003c/template\u003e\n```\n\n## Used with 3rd-party libraries\n\n### Vuetify v-textarea\n\n```vue\n\u003cat-ta :members=\"members\"\u003e\n  \u003c!-- slots --\u003e\n  \u003cv-textarea v-model=\"text\"\u003e\u003c/v-textarea\u003e\n\u003c/at-ta\u003e\n```\n\n### Element-UI el-input\n\n```vue\n\u003cat-ta :members=\"members\"\u003e\n  \u003c!-- slots --\u003e\n  \u003cel-input v-model=\"text\" type=\"textarea\"\u003e\u003c/el-input\u003e\n\u003c/at-ta\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffritx%2Fvue-at","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffritx%2Fvue-at","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffritx%2Fvue-at/lists"}