Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/devui-vue/devui/tag-input/src/remove-btn.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-len */
export default (
<svg
width="12px"
Expand Down
8 changes: 4 additions & 4 deletions packages/devui-vue/devui/tag-input/src/tag-input-types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { ExtractPropTypes, PropType } from "vue";

export interface Suggestion {
__index: number;
[x: string]: any;
__index?: number;
[x: string]: unknown;
}

export const tagInputProps = {
tags: {
type: Array as PropType<any[]>,
type: Array as PropType<Suggestion[]>,
default: (): [] => []
},
displayProperty: {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const tagInputProps = {
default: true
},
suggestionList: {
type: Array as PropType<any[]>,
type: Array as PropType<Suggestion[]>,
default: (): [] => []
},
disabled: {
Expand Down
8 changes: 4 additions & 4 deletions packages/devui-vue/devui/tag-input/src/tag-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default defineComponent({
props: tagInputProps,
emits: ['update:tags', 'update:suggestionList', 'valueChange'],
setup(props: TagInputProps, ctx: SetupContext) {
const add = (arr: any[], target: any) => {
const add = (arr: Suggestion[], target: Suggestion) => {
const res = Object.assign({}, target);
delete res.__index;
return arr.concat(res);
};
const remove = (arr: any[], targetIdx: number) => {
const remove = (arr: Suggestion[], targetIdx: number) => {
const newArr = arr.slice();
newArr.splice(targetIdx, 1);
return newArr;
Expand Down Expand Up @@ -224,7 +224,7 @@ export default defineComponent({
onKeydown={onInputKeydown}
onFocus={onInputFocus}
onBlur={onInputBlur}
onInput={($event: any) => onInput($event)}
onInput={($event: InputEvent) => onInput($event)}
placeholder={isTagsLimit ? `${maxTagsText} ${maxTags}` : placeholder}
spellcheck={spellcheck}
disabled={isTagsLimit}
Expand All @@ -237,7 +237,7 @@ export default defineComponent({
{
mergedSuggestions.length === 0 ?
noDataTpl :
mergedSuggestions.map((item: any, index: number) => {
mergedSuggestions.map((item: Suggestion, index: number) => {
return (
<li
class={{ 'devui-suggestion-item': true, selected: index === selectIndex }}
Expand Down