# SubmitButton 按钮提交 
统一封装。不用算高度了。自带登录逻辑。
# 基础用法
<template>
<qinui-theme v-model="theInited">
<qinui-submit-button
minHeight="100vh"
useLogin
fixed
buttonText="提交"
buttonDisabled
@click="onSave"
:logined="theIsLogin"
:minAfterAuth="onAfterAuth"
loginContent="登录后创建常用人"
>
<qinui-submit-button buttonText="保存" @click="onSave" />
<div style="height: 2000rpx; background-color: aqua" />
<div>底部了</div>
</qinui-submit-button>
</qinui-theme>
</template>
<script lang="ts" setup>
import { onShow } from '@fe6/qinjs-app';
import { onBeforeMount, shallowRef } from 'vue';
const onSave = (theEv: any) => {
console.log(theEv, 'theEv');
};
const theInited = shallowRef(false);
const theIsLogin = shallowRef(false);
const onAfterAuth = (theItem: any) => {
console.log(theItem, '授权成功');
theIsLogin.value = true;
};
onShow(async () => {
setTimeout(() => {
theInited.value = true;
// 获取 code
}, 50);
});
onBeforeMount(() => {
// 获取 code
qin.login({
complete(resCode) {
console.log(resCode, 'resCode');
},
});
});
</script>
# API
# Props
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|---|---|---|---|---|
| buttonText | 按钮文案 | String | 保存 | - |
| buttonDisabled | 按钮禁用 | Boolean | false | - |
| zIndex | 层级 | String | Number | - | - |
| minHeight | 最小高度 | String | - | - |
| fixed | 是否固定在底部 | Boolean | false | - |
| useLogin | 是否使用登录组件,示例 | Boolean | false | true | false |
| loginContent | 未登录文案 | String | - | - |
| logined | 是否登录 | Boolean | false | true | false |
| h5Auth | H5 点击回调 | Function | - | - |
| minAfterAuth | 小程序 点击回调 | Function | - | - |
| emptyImage | 空状态图片地址 | String | no-content.png | - |
# Events
| 事件名 | 说明 | 回调参数 |
|---|---|---|
| @click | 按钮触发 | - |
| @inited | 初始化触发 | - |