# QRCodePopup 二维码弹出层
# 引入
import PressQRCodePopup from 'press-plus/press-q-r-code-popup/press-q-r-code-popup';
export default {
components: {
PressQRCodePopup,
}
}
# 代码演示
# 基础用法
<PressQRCodePopup
v-if="show"
:qr-code-url="currentUrl"
:type="type"
@onCancel="show = false"
/>
export default {
components: {
PressQRCodePopup,
},
data() {
let currentUrl = 'https://baidu.com';
// #ifdef H5
currentUrl = document.location.href;
// #endif
return {
currentUrl,
show: false,
type: 1,
};
},
methods: {
showDialog() {
this.show = true;
},
},
};
# API
# Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| qr-code-url | 二维码 URL | string | - |
| type | 扫码类型,可选值为 1(QQ), 2(微信) | number | 2 |
| title | 标题,为空时根据 type 自动生成 | string | - |
| description | 二维码描述 | string | 截图或长按保存图片 |
| tip | 二维码底部提示,为空时根据 type 自动生成 | string | - |
| use-tip-class | 是否使用 tip-comp 为前缀的类名 | boolean | false |
# Events
| 事件名 | 说明 | 参数 |
|---|---|---|
| onCancel | 点击取消 | - |
← Protocol TeamSearch →