浏览代码

Merge branch 'next' of https://github.com/jdf2e/nutui into next

Drjnigfubo 3 年之前
父节点
当前提交
48d985b2e6

+ 4 - 1
src/packages/__VUE/addresslist/index.taro.vue

@@ -65,7 +65,7 @@
   </div>
 </template>
 <script lang="ts">
-import { toRefs, reactive, onMounted, ref } from 'vue';
+import {toRefs, reactive, onMounted, ref, watch} from 'vue';
 import { createComponent } from '@/packages/utils/create';
 const { componentName, create, translate } = createComponent('addresslist');
 import LongPressShell from './components/LongPressShell.vue';
@@ -129,6 +129,9 @@ export default create({
       }
     };
 
+    // 监听props.data的变更重新渲染列表
+    watch(() => props.data, () => trowelData(), {deep:true});
+
     const clickDelIcon = (event, item) => {
       emit('handelDelIcon', event, item);
       event.stopPropagation();

+ 1 - 0
src/packages/__VUE/input/doc.md

@@ -418,6 +418,7 @@ app.use(Icon);
 | error-message-align | 底部错误提示文案对齐方式,可选值 `left`、`center`、`right`          | String | - |
 | formatter      | 输入内容格式化函数    | `(val: string) => string` | - |
 | format-trigger | 格式化函数触发的时机,可选值为 `onChange`、`onBlur` | String | - |
+| confirm-type   | 键盘右下角按钮的文字(`仅支持小程序`),仅在`type='text'`时生效,可选值 `send`:发送、`search`:搜索、`next`:下一个、`go`:前往、`done`:完成 | String |   `done`   |
 | adjust-position| 键盘弹起时,是否自动上推页面,仅支持原生     | Boolean | `true` |
 
 ### Event

+ 5 - 0
src/packages/__VUE/input/index.taro.vue

@@ -51,6 +51,7 @@
           :value="modelValue"
           :formatTrigger="formatTrigger"
           :autofocus="autofocus"
+          :confirm-type="confirmType"
           :adjust-position="adjustPosition"
           @input="onInput"
           @focus="onFocus"
@@ -224,6 +225,10 @@ export default create({
       type: Boolean,
       default: false
     },
+    confirmType: {
+      type: String as PropType<import('./type').ConfirmTextType>,
+      default: 'done'
+    },
     adjustPosition: {
       type: Boolean,
       default: true

+ 2 - 0
src/packages/__VUE/input/type.ts

@@ -31,3 +31,5 @@ export type InputRule = {
   message?: string;
   required?: boolean;
 };
+
+export type ConfirmTextType = 'send' | 'search' | 'next' | 'go' | 'done';

+ 1 - 1
src/packages/__VUE/popup/index.taro.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view :catch-move="lockScroll">
     <nut-overlay
       v-if="overlay"
       :visible="visible"

+ 4 - 1
src/packages/__VUE/searchbar/doc.md

@@ -197,6 +197,9 @@ app.use(SearchBar).use(Icon);
 | clearable          | 是否展示清除按钮 | Boolean | true     |
 | background      | 输入框外部背景 | String |   '#fff'   |
 | input-background   | 输入框内部背景 | String |   '#f7f7f7'   |
+| input-background   | 输入框内部背景 | String |   '#f7f7f7'   |
+| confirm-type   | 键盘右下角按钮的文字(`仅支持小程序`),仅在`type='text'`时生效,可选值 `send`:发送、`search`:搜索、`next`:下一个、`go`:前往、`done`:完成 | String |   `done`   |
+| input-background   | 输入框内部背景 | String |   '#f7f7f7'   |
 | autofocus `v3.1.21` | 是否自动聚焦 | boolean | false |
 | disabled `v3.1.21` | 是否禁用输入框 | boolean | false |
 | readonly `v3.1.21`| 输入框只读 | boolean | false |
@@ -224,4 +227,4 @@ app.use(SearchBar).use(Icon);
 | leftin      | 输入框内 左icon  |
 | leftout     | 输入框外 左icon |
 | rightin     | 输入框内 右icon |
-| rightout    | 输入框外 右icon |
+| rightout    | 输入框外 右icon |

+ 8 - 1
src/packages/__VUE/searchbar/index.taro.vue

@@ -16,6 +16,7 @@
             :maxlength="maxLength"
             :placeholder="placeholder || translate('placeholder')"
             :value="modelValue"
+            :confirm-type="confirmType"
             :disabled="disabled"
             :readonly="readonly"
             @click="clickInput"
@@ -41,13 +42,15 @@
 </template>
 
 <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';
 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({
   props: {
     modelValue: {
@@ -78,6 +81,10 @@ export default create({
       type: String,
       default: ''
     },
+    confirmType: {
+      type: String as PropType<confirmTextType>,
+      default: 'done'
+    },
     autofocus: {
       type: Boolean,
       default: false

+ 3 - 2
src/sites/mobile-taro/vue/src/dentry/pages/searchbar/index.vue

@@ -14,7 +14,7 @@
     </nut-searchbar>
 
     <h2>右侧添加搜索文字</h2>
-    <nut-searchbar v-model="searchValue3">
+    <nut-searchbar v-model="searchValue3" :confirm-type="confirmType">
       <template v-slot:rightout> 搜索 </template>
     </nut-searchbar>
 
@@ -55,7 +55,8 @@ export default {
       searchValue2: '',
       searchValue3: '',
       searchValue4: '',
-      searchValue5: ''
+      searchValue5: '',
+      confirmType: 'search',
     });
 
     const search = function (e: any) {