未验证 提交 008cb18e 编写于 作者: D Drjingfubo 提交者: GitHub

upd: shortpassword、drag、tabbar、actionsheet (#412)

* upd: drag,shortpassword

* upd: tabbar,shortpassword,actionsheet

* upd: shortpassword新增方法
Co-authored-by: richard_1015's avatarrichard1015 <51844712@qq.com>
上级 04cd2b27
......@@ -10,6 +10,8 @@
@complete="methods.onComplete"
@ok="methods.onOk"
@tips="methods.onTips"
@close="methods.close"
@cancel="methods.cancel"
>
</nut-shortpassword>
<nut-cell
......@@ -92,6 +94,12 @@ export default createDemo({
onComplete() {},
onTips() {
ctx.$toast.text('执行忘记密码逻辑');
},
close() {
ctx.$toast.text('点击icon关闭弹窗');
},
cancel() {
ctx.$toast.text('点击取消按钮关闭弹窗');
}
};
......
......@@ -103,6 +103,7 @@ setup() {
| tips | 提示语| String | 忘记密码|
| visible | 是否展示短密码框| Boolean | false|
| value | 密码初始值 | String | ''|
| close-on-click-overlay | 是否点击遮罩关闭 | Boolean | true|
| no-button | 是否隐藏底部按钮 |Boolean|true|
| length | 密码长度,取值为4~6 |String||Number|6|
| error-msg | 错误信息提示 |String|''|
......@@ -114,4 +115,7 @@ setup() {
|----- | ----- | -----
| change | 输入密码时触发事件 | --
| ok | 点击确实时触发事件 | value
| cancel | 点击取消时触发事件| value
| close | 点击关闭图标时触发事件| value
| complete | 输入完成的回调 | value
......@@ -8,7 +8,8 @@
}"
v-model:show="show"
:closeable="true"
@click-close-icon="close"
@click-close-icon="closeIcon"
:close-on-click-overlay="closeOnClickOverlay"
@click-overlay="close"
>
<view class="nut-shortpsd-title">{{ title }}</view>
......@@ -83,12 +84,25 @@ export default create({
type: Boolean,
default: true
},
closeOnClickOverlay: {
type: Boolean,
default: true
},
length: {
type: [String, Number], //4~6
default: 6
}
},
emits: ['update:value', 'update:visible', 'complete', 'change', 'ok', 'tips'],
emits: [
'update:value',
'update:visible',
'complete',
'change',
'ok',
'tips',
'close',
'cancel'
],
setup(props, { emit }) {
const realInput = ref(props.value);
const realpwd = ref();
......@@ -122,6 +136,11 @@ export default create({
}
function close() {
emit('update:visible', false);
emit('cancel');
}
function closeIcon() {
emit('update:visible', false);
emit('close');
}
function range(val: number) {
return Math.min(Math.max(4, val), 6);
......@@ -139,7 +158,8 @@ export default create({
changeValue,
close,
onTips,
show
show,
closeIcon
};
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册