# QRCodePopup
# Introduction
import PressQRCodePopup from '@tencent/press-plus/press-q-r-code-popup/press-q-r-code-popup';
export default {
components: {
PressQRCodePopup,
}
}
# Code Demo
# Basic usage
<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
Parameters | Description | Type | Default value |
---|---|---|---|
qr-code-url | QR code URL | string | - |
type | Scan code type, optional values are 1 (QQ), 2 (WeChat) | number | 2 |
title | Title, automatically generated based on type when empty | string | - |
# Events
Event name | Description | Parameters |
---|---|---|
onCancel | Click to cancel | - |
← Protocol TeamSearch →