npm install --save qrcode.vue
或者
yarn add qrcode.vue
import QrcodeVue from 'qrcode.vue'
<qrcode-vue :value="qrCode123" size:300 >qrcode-vue>
:value="qrCode123"是二维码中的值
- <template>
- <el-button text @click="dialogVisible = true"
- >click to open the Dialog
- >
-
- <el-dialog
- v-model="dialogVisible"
- title="Tips"
- width="30%"
- :before-close="handleClose"
- >
- <qrcode-vue :value="qrCode123" size:300 >qrcode-vue>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false">Cancelel-button>
- <el-button type="primary" @click="dialogVisible = false"
- >Confirm
- >
- span>
- template>
- el-dialog>
- template>
-
- <script lang="ts" setup>
- import { ref } from 'vue'
- import { ElMessageBox } from 'element-plus'
- import QrcodeVue from 'qrcode.vue'
-
- const dialogVisible = ref(false)
- const qrCode123 = ref("我是二维码信息")
-
- const handleClose = (done: () => void) => {
- ElMessageBox.confirm('Are you sure to close this dialog?')
- .then(() => {
- done()
- })
- .catch(() => {
- // catch error
- })
- }
- script>
- <style scoped>
- .dialog-footer button:first-child {
- margin-right: 10px;
- }
- style>
Vue3介绍(不用理会)
vue3.0带来了什么
1.性能的提升
打包大小减少41%
初次渲染快55%,更新渲染块133%
内存减少54%
........
2.源码的升级
使用Proxy代替defineProperty实现响应式
重写虚拟DOM的实现和Tree-Sharking
......
3.拥抱TypeScript
vue3.0更好的支持TypeScript
4.新的特性
Composition API(组合api)
。 setup配置
。ref与reactive
。watch与watchEffect
。 provide和inject
。 .......
新的内置组件
。 Fragment
。Teleport
。Suspense
其他改变
。新的生命周期钩子
。data选项应始终被声明为一个函数
。移除keyCode支持作为v-on的修饰符
-
相关阅读:
C++ std::string 删除指定字符
使用tesseract-ocr实现图片中的中英文字符提取
SAP FI/SD的集成-VKOA科目确定
golang validator基于map规则验证集合和结构体
LeetCode/LintCode 题解丨一周爆刷字符串:乱序字符串
同花顺_代码解析_交易系统_J01_08
windows查看登陆的IP
Xilinx ZYNQ 7000学习笔记四(MultiBoot多重启动)
uniapp条件编译
垂直领域大模型落地思考
-
原文地址:https://blog.csdn.net/QQ675396947/article/details/126663952