当前位置:网站首页>CDN mode uses vant components, and components cannot be called after they are introduced
CDN mode uses vant components, and components cannot be called after they are introduced
2022-07-29 00:29:00 【qiansli12138】
problem : The project uses html Written h5 page , It uses vue+jquery, Because we need to do a function of image preview , I think of it. vant Inside ImagePreview Components , I want to use it , But there was a problem when it was introduced .
1. introduce css file
<link rel="stylesheet" type="text/css" href="../../lib/vant/index.css"/>
2. introduce js file
<script type="text/javascript" src="../../lib/vue/vue.min.js"></script>
<script type="text/javascript" src="../../lib/vant/vant.min.js"></script>
3. Register to use vant
Vue.use(vant.ImagePreview)
4. Use components
Using components and import Somewhat different , You can fill in the value by yourself , I use it when I click on the page image
changeimg () {
console.log("999")
vant.ImagePreview({
images: ["https://m.360buyimg.com/babel/jfs/t1/44979/17/18719/194364/62be70ddEe3749112/5873151012657077.jpg.webp","https://m.360buyimg.com/babel/jfs/t1/44979/17/18719/194364/62be70ddEe3749112/5873151012657077.jpg.webp"],
startPosition: '1'
})
}
5. Page components
<vant-image-preview>
<img @click="changeimg" src="https://m.360buyimg.com/babel/jfs/t1/44979/17/18719/194364/62be70ddEe3749112/5873151012657077.jpg.webp" >
<img @click="changeimg" src="https://m.360buyimg.com/babel/jfs/t1/44979/17/18719/194364/62be70ddEe3749112/5873151012657077.jpg.webp" >
<img @click="changeimg" src="https://m.360buyimg.com/babel/jfs/t1/44979/17/18719/194364/62be70ddEe3749112/5873151012657077.jpg.webp" >
</vant-image-preview>
The size of the picture of the page . The order of display or something , Then modify it according to the data transferred from the background , Now it's just dead data .ok La !
边栏推荐
- 【微服务~Nacos】Nacos服务提供者和服务消费者
- 乱打日志的男孩运气怎么样我不知道,加班肯定很多!
- CV instance segmentation model sketch (1)
- MySQL sub database and sub table and its smooth expansion scheme
- Camera Hal OEM module ---- CMR_ preview.c
- vulnhub:SolidState
- 【开发教程10】疯壳·开源蓝牙心率防水运动手环-蓝牙 BLE 收发
- MySQL stored procedure
- MySql中的like和in走不走索引
- Detailed explanation of the usage of exists in MySQL
猜你喜欢
动态规划问题(五)
IDEA 连接 数据库
Sword finger offer 55 - I. depth of binary tree
Newscenter, advanced area of attack and defense world web masters
Software designer - intermediate, exam summary
Plato farm is expected to further expand its ecosystem through elephant swap
html+css+php+mysql实现注册+登录+修改密码(附完整代码)
Kali installs burpsuite professional
Sword finger offer 41. median in data flow
Geth installation
随机推荐
PTA (daily question) 7-74 yesterday
Dynamic programming problem (VIII)
What does WGet mean
动态规划问题(二)
Dynamic programming problem (1)
Teach you how to install latex (nanny level tutorial)
【网络安全】通过iptables和ipset完成服务器防火墙黑名单和白名单功能
PTA (daily question) 7-71 character trapezoid
PTA (daily question) 7-73 turning triangle
Cause analysis of 12 MySQL slow queries
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
Event extraction and documentation (2018)
【开发教程11】疯壳·开源蓝牙心率防水运动手环-整机功能代码讲解
Dynamic programming problem (4)
DCAT in laravel_ Admin preliminary use record
What are the skills of API interface optimization?
Solutions such as failed plug-in installation and slow speed of linking remote server under vscode
最长上升子序列
CV target detection model sketch (2)
110 MySQL interview questions and answers (continuously updated)