当前位置:网站首页>Adjust SVG width and height
Adjust SVG width and height
2022-06-12 08:36:00 【Month to month better】
svg It is obtained from the back-end data , Get svg Then append it to wechat_qrcode Rendering in tags , Back end svg The width and height displayed are 207207 Do not conform to the UI280280, It is necessary to adjust its svg Wide and high 
adjustment svg Width and height must be combined viewBox Use
<li id="wechat_qrcode" ref="wechat_qrcode"></li>
mounted(){
this.fetchclientqrcode()
}
methods:{
fetchclientqrcode() {
return this.$http
.get(`/api/qrcode`)
.delegateTo(api_request)
.then((res) => {
this.$nextTick(() => {
this.$refs.wechat_qrcode.innerHTML = res.qrcode;
const svg = document.getElementsByClassName("pyqrcode")[0];
svg.setAttribute("width","280");
svg.setAttribute("height","280");
svg.setAttribute("viewBox","0 0 210 210");
});
})
.catch(({
code, message }) => {
throw ` Failed to get data :${
this.$t("api." + code)}, Additional information : ${
this.$t( "api." + typeof message === "string" ? message : JSON.stringify(message) )}`;
})
.delegateTo(this.$snackbar.delegateError);
}
}

边栏推荐
- This article is required for the popularization of super complete MES system knowledge
- What is the beauty of MES equipment management for enterprises?
- What is the MES system? What is the operation process of MES system?
- JVM学习笔记:垃圾回收机制
- 记Date类型的一次踩坑
- FDA reviewers say Moderna covid vaccine is safe and effective for children under 5 years of age
- 【指針進階三】實現C語言快排函數qsort&回調函數
- API处理Android安全距离
- Model Trick | CVPR 2022 Oral - Stochastic Backpropagation A Memory Efficient Strategy
- [dynamic memory management] malloc & calloc and realloc and written test questions and flexible array
猜你喜欢

In the era of intelligent manufacturing, how do enterprises carry out digital transformation

JVM learning notes: three local method interfaces and execution engines

工厂的生产效益,MES系统如何提供?

Hands on deep learning -- image classification dataset fashion MNIST
![[compilation principle] understand BNF](/img/64/9a0e7507606781336fdc44116ba423.jpg)
[compilation principle] understand BNF

安科瑞电动机保护器具有过载反时限、过载定时限、接地、起动超时、漏电、欠载、断相、堵转等功能

余压监控系统保证火灾发生时消防疏散通道的通畅,为大型高层建筑的安全运行和人民生命财产安全保驾护航

【指针进阶三】实现C语言快排函数qsort&回调函数

Error: what if the folder cannot be deleted when it is opened in another program

Website colab and kaggle
随机推荐
(p27-p32) callable object, callable object wrapper, callable object binder
Is it really expensive for enterprises to launch MES software?
【指针进阶三】实现C语言快排函数qsort&回调函数
Only use MES as a tool? Looks like you missed the most important thing
Hands on deep learning -- discarding method and its code implementation
MYSQL中的锁的机制
At present, MES is widely used. Why are there few APS scheduling systems? Why?
R loop assignment variable name
ctfshow web4
JVM learning notes: garbage collection mechanism
【指針進階三】實現C語言快排函數qsort&回調函數
正则校验用户名
[advanced pointer III] implement C language quick sorting function qsort & callback function
What is the MES system? What is the operation process of MES system?
Centos8 installing MySQL 8.0 (upper)
Error: ER_ NOT_ SUPPORTED_ AUTH_ MODE: Client does not support authentication protocol requested ... ...
What is the beauty of MES equipment management for enterprises?
Code generation tool Autocode for XML Publishing
The era of post MES system has come gradually
What is the quality traceability function of MES system pursuing?