mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Refactor #3922 - For InputText
This commit is contained in:
parent
c1a506287b
commit
24538f0fd0
4 changed files with 37 additions and 1 deletions
25
components/lib/inputtext/InputText.d.ts
vendored
25
components/lib/inputtext/InputText.d.ts
vendored
|
@ -10,6 +10,26 @@
|
|||
import { InputHTMLAttributes } from 'vue';
|
||||
import { ClassComponent, GlobalComponentConstructor, Nullable } from '../ts-helpers';
|
||||
|
||||
export declare type InputTextPassThroughOptionType = InputTextPassThroughAttributes | null | undefined;
|
||||
|
||||
/**
|
||||
* Custom passthrough(pt) options.
|
||||
* @see {@link InputTextProps.pt}
|
||||
*/
|
||||
export interface InputTextPassThroughOptions {
|
||||
/**
|
||||
* Uses to pass attributes to the root's DOM element.
|
||||
*/
|
||||
root?: InputTextPassThroughOptionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom passthrough attributes for each DOM elements
|
||||
*/
|
||||
export interface InputTextPassThroughAttributes {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines valid properties in InputText component.
|
||||
*/
|
||||
|
@ -18,6 +38,11 @@ export interface InputTextProps extends InputHTMLAttributes {
|
|||
* Value of the component.
|
||||
*/
|
||||
modelValue?: Nullable<string>;
|
||||
/**
|
||||
* Uses to pass attributes to DOM elements inside the component.
|
||||
* @type {InputTextPassThroughOptions}
|
||||
*/
|
||||
pt?: InputTextPassThroughOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<template>
|
||||
<input :class="['p-inputtext p-component', { 'p-filled': filled }]" :value="modelValue" @input="onInput" />
|
||||
<input :class="['p-inputtext p-component', { 'p-filled': filled }]" :value="modelValue" @input="onInput" v-bind="ptm('root')" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseComponent from 'primevue/basecomponent';
|
||||
|
||||
export default {
|
||||
name: 'InputText',
|
||||
extends: BaseComponent,
|
||||
emits: ['update:modelValue'],
|
||||
props: {
|
||||
modelValue: null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue