美文网首页
uniapp text 中使用 图标库

uniapp text 中使用 图标库

作者: 偶头像超凶 | 来源:发表于2021-09-07 16:42 被阅读0次

由于 text 中不能使用 <slot></slot>,所有用的传值
重点 :iconFlog="'\ue6e3'"
重点 :iconFlog="'\ue6e3'"
重点 :iconFlog="'\ue6e3'"
一定要这么写 ,不要 iconFlog="\ue6e3"

1、父组件中 , 重点 :iconFlog="'\ue6e3'" ,一定要这么写

<free-icon-button :iconFlog="'\ue6e3'" @click="search()"></free-icon-button>
import freeIconButton from '@/components/free-ui/free-icon-button.vue'
export default {
    components: {
        freeIconButton
    }
}

2、子组件: free-icon-button.vue

<template>
    <view @click="$emit('click')"  style="width: 90rpx; height: 90rpx;">
        <text class="iconfont font-md"> {{iconFlog}} </text>    
    </view>
</template>
export default{
    props:{
        iconFlog:{
            type: String,
            default: ''
        }
    }
}

相关文章

网友评论

      本文标题:uniapp text 中使用 图标库

      本文链接:https://www.haomeiwen.com/subject/nolpwltx.html