{"id":20139256,"url":"https://github.com/lpreterite/iview-typeahead-input","last_synced_at":"2026-04-14T07:32:15.573Z","repository":{"id":81485854,"uuid":"90099629","full_name":"lpreterite/iview-typeahead-input","owner":"lpreterite","description":"typeahead component for iview","archived":false,"fork":false,"pushed_at":"2017-06-06T04:03:22.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T23:16:52.959Z","etag":null,"topics":["input","iview","typeahead","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/lpreterite.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":"2017-05-03T02:30:48.000Z","updated_at":"2017-07-13T09:51:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"d8e30830-73b9-44d0-9ea2-5bca887abcfb","html_url":"https://github.com/lpreterite/iview-typeahead-input","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lpreterite/iview-typeahead-input","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fiview-typeahead-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fiview-typeahead-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fiview-typeahead-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fiview-typeahead-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpreterite","download_url":"https://codeload.github.com/lpreterite/iview-typeahead-input/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpreterite%2Fiview-typeahead-input/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31786784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["input","iview","typeahead","vue"],"created_at":"2024-11-13T21:44:33.522Z","updated_at":"2026-04-14T07:32:15.555Z","avatar_url":"https://github.com/lpreterite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iview-typeahead-input\ntypeahead component for iview by [vue-typeahead](https://github.com/pespantelis/vue-typeahead)\n\n## How to use\n### setup\n```\nnpm install lpreterite/iview-typeahead-input\n```\n\n### use\n```\nimport Vue from 'vue';\nimport TypeaheadInput from 'iview-typeahead-input';\nimport 'iview/dist/styles/iview.css';\nimport axios from 'axios';\n\nVue.prototype.$http = axios;\nVue.component('TypeaheadInput', TypeaheadInput);\n\nvar vm = new Vue({\n    el: '#app',\n    data: function(){\n        return {\n            src: '//localhost:8080/typeahead',\n            input: '',\n            selection: {\n                id: 0,\n                name: ''\n            }\n        }\n    },\n    methods: {\n        convent(data){\n            return data;\n        }\n    }\n})\n```\n\n### template\n```\n\u003cdiv id=\"app\"\u003e\n    \u003ctypeahead-input\n        ref=\"typeahead\"\n        :src=\"src\"\n        placeholder = 'something...'\n        :limit = '20'\n        :minChars = '2'\n        :autocomplete = 'true'\n        :paramName=\"keywords\"\n        :itemTitleKey=\"name\"\n        :selectedFirst=\"false\"\n        :convent=\"convent\"\n        v-model=\"input\"\n        @changed=\"selection = arguments[0]\"\n    \u003e\u003c/typeahead-input\u003e\n\u003c/div\u003e\n```\n\n### props\n\n`src`: 数据源url\n\n`limit`: 显示item最大数\n\n`minChars`: 响应字符数，输入字符超出时才响应请求\n\n`autocomplete`: 自动补全\n\n`paramName`: 请求时的字段名称，默认`keywords`(?keywords=xxx)\n\n`itemTitleKey`: item显示字段，默认`name`\n\n`selectedFirst`: 自动选择第一个，默认`true`\n\n`convent`: 请求后的数据处理方法，可选\n\n`v-model`: 绑定输入框内容\n\n### methods\n\n`clear()` 清除当前状态 \n\n### attr\n\n`isEmpty`: 输入空是否为空\n\n`isDirty`: 用于判断是否已选择\n\n`hasItems`: 用于判断是否有数据返回\n\n#### attr example\n```\n{\n...\nmethods: {\n    test(){\n        console.log(this.refs.typeahead.isDirty);\n    }\n}\n...\n}\n```\n\n## Build\n```\nnpm i \nnpm run build\n```\n\n## Test\n```\nnpm i\nnpm run mock\nnpm run dev\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpreterite%2Fiview-typeahead-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpreterite%2Fiview-typeahead-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpreterite%2Fiview-typeahead-input/lists"}