uni-app 钉钉小程序真机调试时 uni-ui 不生效
uni-app 钉钉小程序真机调试时 uni-ui 不生效
示例代码:
<view class="ctrlItemContainer">
<uni-icons :class="usernameIconsClass" type="auth" size="30" class="tip-icon"></uni-icons>
<uni-easyinput v-model="username" :styles="usernameInputStyle" class="uni-mt-5" trim="all"
@focus="handleInputFocus" />
</view>
<view class="ctrlItemContainer">
<uni-icons :class="passwordIconsClass" type="locked" size="30" class="tip-icon"></uni-icons>
<uni-easyinput v-model="password" :styles="passwordInputStyle" type="password" class="uni-mt-5" trim="all"
@focus="handleInputFocus" />
</view>
操作步骤:
<view class="ctrlItemContainer">
<uni-icons :class="usernameIconsClass" type="auth" size="30" class="tip-icon"></uni-icons>
<uni-easyinput v-model="username" :styles="usernameInputStyle" class="uni-mt-5" trim="all"
@focus="handleInputFocus" />
</view>
<view class="ctrlItemContainer">
<uni-icons :class="passwordIconsClass" type="locked" size="30" class="tip-icon"></uni-icons>
<uni-easyinput v-model="password" :styles="passwordInputStyle" type="password" class="uni-mt-5" trim="all"
@focus="handleInputFocus" />
</view>
预期结果:
正常显示uni-ui
实际结果:
uni-ui不生效
bug描述:
uni-ui在钉钉开发者工具调试和真机调试中不生效,预览正常
附件:
5 回复
已经解决,hbuilder3.9.9必须对应最新版的钉钉开发者工具3.8.4,否则就会出现上述样式问题
感谢你为开发者社区做出的贡献
能否贴出你的css代码或者提供完整工程,我在开发者工具/真机调试/预览测试均正常。
已解决,hbuilder3.9.9必须对应最新版的钉钉开发者工具3.8.4,否则就会出现上述样式问题
在使用 uni-app 开发钉钉小程序时,如果遇到 uni-ui
组件在真机调试时不生效的问题,可以按照以下步骤进行排查和解决:
1. 检查 uni-ui 版本
确保你使用的是最新版本的 uni-ui
。可以通过以下命令更新 uni-ui
:
npm update @dcloudio/uni-ui
2. 确认组件引入方式
确保你在页面或组件中正确引入了 uni-ui
组件。例如:
<template>
<uni-button type="primary">按钮</uni-button>
</template>
<script>
import uniButton from '@dcloudio/uni-ui/lib/uni-button/uni-button.vue';
export default {
components: {
uniButton
}
}
</script>
3. 检查编译配置
确保在 pages.json
中正确配置了 usingComponents
。例如:
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页",
"usingComponents": {
"uni-button": "@dcloudio/uni-ui/lib/uni-button/uni-button"
}
}
}
]
}