请教问题,layui step 这个分步表单的高度怎么自适应
这里设置height: auto 是不显示 的 指定高度是可以显示的
这是那个步骤条配置
`// 步骤条配置
layui.config({
base: './step-lay/'
}).use(['form', 'step'], function () {
var $ = layui.$,
form = layui.form,
step = layui.step;
// 获取 URL 参数中的当前步骤索引值
var urlParams = new URLSearchParams(window.location.search);
var currentStep = parseInt(urlParams.get('step')) || 0;
step.render({
elem: '#stepForm',
filter: 'stepForm',
width: '100%',
stepWidth: '92%',
height: 'auto',
stepItems: [
{title: '阅读须知'},
{title: '填写信息'},
{title: '上传材料'},
{title: '结果领取'},
{title: '申请成功'}
],
// 设置当前步骤
step: currentStep,
// 监听步骤切换事件
stepChange: function (currentStepIndex) {
// 更新 URL 参数中的当前步骤索引值
updateUrlParams(currentStepIndex);
}
});
form.on('submit(formStep)', function (data) {
step.next('#stepForm');
return false;
});
form.on('submit(formStep2)', function (data) {
step.next('#stepForm');
return false;
});
$('.pre').click(function () {
step.pre('#stepForm');
});
$('.next').click(function () {
step.next('#stepForm');
});
// 更新 URL 参数中的当前步骤索引值
function updateUrlParams(currentStepIndex) {
var url = new URL(window.location.href);
url.searchParams.set('step', currentStepIndex.toString());
var newUrl = url.toString();
window.history.replaceState({path: newUrl}, '', newUrl);
}
});`