From 8314e19556d5afbd700e6709cc9bc5a764c4455a Mon Sep 17 00:00:00 2001
From: suzigang <1039168735@qq.com>
Date: Wed, 14 Sep 2022 16:58:07 +0800
Subject: [PATCH] fix(searchbar): textalign types
---
package.json | 4 ++--
src/packages/__VUE/searchbar/index.taro.vue | 21 ++++++---------------
src/packages/__VUE/searchbar/index.vue | 3 +--
src/packages/__VUE/searchbar/type.ts | 1 +
4 files changed, 10 insertions(+), 19 deletions(-)
create mode 100644 src/packages/__VUE/searchbar/type.ts
diff --git a/package.json b/package.json
index 1d9d6310a5..c8bcc7d332 100644
--- a/package.json
+++ b/package.json
@@ -116,10 +116,10 @@
"transliteration": "^2.2.0",
"ts-jest": "^26.5.5",
"typescript": "4.6.4",
- "vite": "^2.9.12",
+ "vite": "2.9.0",
"vite-plugin-dts": "^1.0.5",
"vite-plugin-md": "^0.11.8",
- "vue": "3.2.24",
+ "vue": "^3.2.24",
"vue-jest": "^5.0.0-alpha.7"
},
"eslintConfig": {
diff --git a/src/packages/__VUE/searchbar/index.taro.vue b/src/packages/__VUE/searchbar/index.taro.vue
index 99a8ed1f29..6208d22e75 100644
--- a/src/packages/__VUE/searchbar/index.taro.vue
+++ b/src/packages/__VUE/searchbar/index.taro.vue
@@ -24,15 +24,10 @@
@focus="valueFocus"
@blur="valueBlur"
@confirm="handleSubmit"
- :style="(styleSearchbar as CSSProperties)"
+ :style="styleSearchbar"
/>
-
+
@@ -50,10 +45,6 @@
import { toRefs, reactive, computed, ref, onMounted, PropType, Ref, CSSProperties } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { create, translate } = createComponent('searchbar');
-// interface Events {
-// eventName: 'change' | 'focus' | 'blur' | 'clear' | 'update:modelValue';
-// params: (string | number | Event)[];
-// }
export type confirmTextType = 'send' | 'search' | 'next' | 'go' | 'done';
export default create({
@@ -202,12 +193,12 @@ export default create({
};
const styleSearchbar = computed(() => {
- return {
- style: {
- textAlign: props.inputAlign
- }
+ const style: CSSProperties = {
+ textAlign: props.inputAlign as import('./type').TextAlign
};
+ return style;
});
+
const inputsearch: Ref = ref(null);
onMounted(() => {
if (props.autofocus) {
diff --git a/src/packages/__VUE/searchbar/index.vue b/src/packages/__VUE/searchbar/index.vue
index 525e7dac48..896653cc5c 100644
--- a/src/packages/__VUE/searchbar/index.vue
+++ b/src/packages/__VUE/searchbar/index.vue
@@ -56,7 +56,6 @@