|
@@ -16,6 +16,7 @@
|
|
|
:maxlength="maxLength"
|
|
:maxlength="maxLength"
|
|
|
:placeholder="placeholder || translate('placeholder')"
|
|
:placeholder="placeholder || translate('placeholder')"
|
|
|
:value="modelValue"
|
|
:value="modelValue"
|
|
|
|
|
+ :confirm-type="confirmType"
|
|
|
:disabled="disabled"
|
|
:disabled="disabled"
|
|
|
:readonly="readonly"
|
|
:readonly="readonly"
|
|
|
@click="clickInput"
|
|
@click="clickInput"
|
|
@@ -41,13 +42,15 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { toRefs, reactive, computed, ref, onMounted } from 'vue';
|
|
|
|
|
|
|
+import { toRefs, reactive, computed, ref, onMounted, PropType } from 'vue';
|
|
|
import { createComponent } from '@/packages/utils/create';
|
|
import { createComponent } from '@/packages/utils/create';
|
|
|
const { create, translate } = createComponent('searchbar');
|
|
const { create, translate } = createComponent('searchbar');
|
|
|
interface Events {
|
|
interface Events {
|
|
|
eventName: 'change' | 'focus' | 'blur' | 'clear' | 'update:modelValue';
|
|
eventName: 'change' | 'focus' | 'blur' | 'clear' | 'update:modelValue';
|
|
|
params: (string | number | Event)[];
|
|
params: (string | number | Event)[];
|
|
|
}
|
|
}
|
|
|
|
|
+export type confirmTextType = 'send' | 'search' | 'next' | 'go' | 'done'
|
|
|
|
|
+
|
|
|
export default create({
|
|
export default create({
|
|
|
props: {
|
|
props: {
|
|
|
modelValue: {
|
|
modelValue: {
|
|
@@ -78,6 +81,10 @@ export default create({
|
|
|
type: String,
|
|
type: String,
|
|
|
default: ''
|
|
default: ''
|
|
|
},
|
|
},
|
|
|
|
|
+ confirmType: {
|
|
|
|
|
+ type: String as PropType<confirmTextType>,
|
|
|
|
|
+ default: 'done'
|
|
|
|
|
+ },
|
|
|
autofocus: {
|
|
autofocus: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false
|
|
default: false
|