由于 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: ''
}
}
}
网友评论