挖坑记录_CSS_WEUI CityPicker控件报错

使用WEUI CityPicker控件 时 ,每次拖动控件改变值 控制台会报错
在这里插入图片描述
在这里插入图片描述
经查询资料 添加css样式 解决问题:


/*解决触摸设备 滑动报错*/
*{
touch-action: none;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
WEUI 风格的 Wizard 控件是一个用于指引用户完成多步骤操作的 UI 组件。下面是一个简单的步骤: 1. 在 HTML 中创建一个包含多个步骤的 Wizard 容器: ```html <div class="weui-wizard"> <div class="weui-wizard__steps"> <div class="weui-wizard__step"></div> <div class="weui-wizard__step"></div> <div class="weui-wizard__step"></div> </div> <div class="weui-wizard__content"></div> </div> ``` 2. 在 CSS 中定义 Wizard 容器的样式: ```css .weui-wizard { display: flex; flex-direction: column; align-items: center; } .weui-wizard__steps { display: flex; justify-content: center; align-items: center; margin-bottom: 10px; } .weui-wizard__step { width: 20px; height: 20px; border-radius: 50%; background-color: #d8d8d8; margin-right: 10px; } .weui-wizard__step:last-child { margin-right: 0; } .weui-wizard__step--active { background-color: #07c160; } ``` 3. 在 JavaScript 中实现 Wizard 控件的逻辑: ```javascript var wizard = document.querySelector('.weui-wizard'); var steps = wizard.querySelectorAll('.weui-wizard__step'); var content = wizard.querySelector('.weui-wizard__content'); var currentStep = 0; function showStep(stepIndex) { if (stepIndex < 0 || stepIndex >= steps.length) { return; } currentStep = stepIndex; steps.forEach(function(step, index) { if (index < stepIndex) { step.classList.add('weui-wizard__step--active'); } else { step.classList.remove('weui-wizard__step--active'); } }); content.innerHTML = 'Step ' + (stepIndex + 1); } showStep(currentStep); document.querySelector('.weui-btn_primary').addEventListener('click', function() { showStep(currentStep + 1); }); document.querySelector('.weui-btn_warn').addEventListener('click', function() { showStep(currentStep - 1); }); ``` 这个示例代码实现了一个包含多个步骤的 Wizard 控件,用户可以通过点击“下一步”和“上一步”按钮来切换步骤。在 showStep 函数中,我们使用了 CSS 类来标识当前步骤。在用户点击“下一步”和“上一步”按钮时,我们调用 showStep 函数来更新当前步骤的状态。 这只是一个简单的示例,你可以根据自己的需求来扩展此控件
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值