Skip to content

Commit bd48abb

Browse files
committed
feat: added attrs prop
1 parent 2650155 commit bd48abb

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ Join our [Discord channel](https://discord.gg/WhX2nG6GTQ) or [open an issue](htt
281281
| **hideSelected** | `boolean` | `true` | Whether selected options should be excluded from the option list when using `multiple` or `tags` mode. |
282282
| **showOptions** | `boolean` | `true` | Whether option list should be displayed. Can be used to create free-typed tags. |
283283
| **object** | `boolean` | `false` | Whether the value should be stored as an object.<br>If **false**:<br>`value: ['js','jsx','ts']`<br>If **true**:<br> `value: [`<br>&nbsp;&nbsp;`{value:'js',label:'Javascript'},`<br>&nbsp;&nbsp;`{value:'jsx',label:'JSX'},`<br>&nbsp;&nbsp;`{value:'ts',label:'Typescript'}`<br>`]` |
284+
| **attrs** | `object` | `{}` | HTML attributes to add to the `input` field when `search` is enabled. |
284285
| **nativeSupport** | `boolean` | `false` | Whether hidden input fields should be appended to achieve native data handling. |
285286

286287
## API

src/Multiselect.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ declare class Multiselect extends Vue {
5050
groupHideEmpty: boolean;
5151
groupSelect: boolean;
5252
inputType: string;
53+
attrs?: object;
5354

5455
$emit(eventName: 'change', e: {originalEvent: Event, value: any}): this;
5556
$emit(eventName: 'select', e: {originalEvent: Event, value: any, option: any}): this;

src/Multiselect.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
:value="search"
1818
:class="classList.search"
1919
:autocomplete="autocomplete"
20+
v-bind="attrs"
2021
@input="handleSearchInput"
2122
@paste.stop="handlePaste"
2223
ref="input"
@@ -58,6 +59,7 @@
5859
:value="search"
5960
:class="classList.tagsSearch"
6061
:autocomplete="autocomplete"
62+
v-bind="attrs"
6163
@input="handleSearchInput"
6264
@paste.stop="handlePaste"
6365
ref="input"
@@ -450,7 +452,12 @@
450452
type: String,
451453
required: false,
452454
default: 'text',
453-
}
455+
},
456+
attrs: {
457+
required: false,
458+
type: [Object],
459+
default: () => ({}),
460+
},
454461
},
455462
setup(props, context)
456463
{

0 commit comments

Comments
 (0)