# 关注公众号(official-account)
关注公众号组件。
# 基本使用
<itu-official-account closeable themeColor="#F5F5F5" title="ITRITON组件库" :logo="require('@/static/logo.png')" :logoStyle="logoStyle" @follow="follow" @close="close"></itu-official-account>
< script >
export default {
data() {
return {
logoStyle: {
width: "76rpx",
height: "76rpx",
borderRadius: "50%",
padding: "20rpx",
}
}
},
onLoad({ title }) {
this.setNavigationBarTitle(title)
},
methods: {
follow() {
this.$itu.showToast({ title: "点击了立即关注" })
},
close() {
this.$itu.showToast({ title: "点击了关闭按钮" })
}
}
} < /script>
# Props
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
themeColor | String | #2979ff | 主题色 |
logo | String | 公众号图标 | |
logoStyle | String | { width: "100rpx", height: "100rpx", borderRadius: "50%" } | 公众号样式 |
title | String | 公众号名称 | 公众号名称 |
titleWidth | String | auto | 公众号宽度 |
tag | String | 公众号 | 标签 |
tagWidth | String | 80rpx | 标签宽度 |
description | String | 关注公众号,及时获取最新信息! | 公众号描述 |
followText | String | 立即关注 | 关注文本 |
followWidth | String | 140rpx | 关注文本宽度 |
closeable | Boolean | false | 是否可关闭 |
closeText | String | 关闭 | 关闭文本 |
border | Boolean | 边框 | true |
borderRadius | String | 圆角 | 16rpx |
# Events
事件名称 | 类型 | 说明 |
---|---|---|
@follow | Function | 关注事件 |
@close | Function | 关闭事件 |