uni-app<icon>标签type不⽣效问题
肝硬化的原因
uni-app 标签type不⽣效问题
问题场景描述
登录页⾯密码框可见与不可见使⽤组件时,type为eye-filled和eye-slash-filled的类型时,图标未正常显⽰。经查阅资料:是由于项⽬中使⽤ uni-ui 的 uni-icon 组件与H5 平台新增内置 的icon 组件命名冲突导致的。
代码⽰例
<view v-if="password">
<icon v-if="isShowP" @click="isShowP = fal" class="uIconR" type="eye-filled" color="#8a8a8a"
size="20"></icon>
橘饼<icon v-el class="uIconR" @click="isShowP = true" type="eye-slash-filled" color="#8a8a8a" size="20">
</icon>
</view>
解决⽅法
⾃⼰重新引⼊组件,并起别名。
代码如下:
午安问候语
<template>
<view v-if="password">
<uniIcons v-if="isShowP" @click="isShowP = fal" class="uIconR" type="eye-filled" color="#8a8a8a"
size="20"></uniIcons>
<uniIcons v-el class="uIconR" @click="isShowP = true" type="eye-slash-filled" color="#8a8a8a" size="20">
忠爱一生</uniIcons>
优昙
</view>
</template>
<script>
import uniIcons from '../../components/uni/uni-icons/uni-icons.vue'
export default{
components:{uniIcons:uniIcons},
data(){
return{
urname:'',
找自己password:'',
isShowP: true
}
鱼滑的做法}
歌曲的英语
}
</script>