当前位置:网站首页>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 !
边栏推荐
- 动态规划问题(六)
- 【网络安全】通过iptables和ipset完成服务器防火墙黑名单和白名单功能
- 刷题的第三十天
- Alibaba code index technology practice: provide reading experience of local IDE for code review
- Do like and in indexes in MySQL go
- 2022网络安全学习路线 非常详细 推荐学习
- MySQL安装配置教程(超级详细、保姆级)
- Table custom style row class name in elemenui
- MySql中的like和in走不走索引
- 乱打日志的男孩运气怎么样我不知道,加班肯定很多!
猜你喜欢
手把手教你安装Latex(保姆级教程)
Event extraction and documentation (2008-2017)
Dynamic programming problem (3)
Why is it so difficult for the SEC to refuse the application for transferring gray-scale GBTC to spot ETF? What is the attraction of ETF transfer?
Advanced area of attack and defense world web masters warmup
12个MySQL慢查询的原因分析
PTA (daily question) 7-70 diamond
【开发教程11】疯壳·开源蓝牙心率防水运动手环-整机功能代码讲解
Basic knowledge of PHP language (super detailed)
html+css+php+mysql实现注册+登录+修改密码(附完整代码)
随机推荐
Introduction and solution of common security vulnerabilities in Web System SQL injection
Newscenter, advanced area of attack and defense world web masters
动态规划问题(五)
动态规划问题(六)
动态规划问题(四)
[development tutorial 10] crazy shell · open source Bluetooth heart rate waterproof sports Bracelet - Bluetooth ble transceiver
Still writing a lot of if to judge? A rule executor kills all if judgments in the project
Sword finger offer 55 - I. depth of binary tree
Dynamic programming problem (6)
vulnhub:BTRSys2
Dynamic programming problem (VII)
PTA (one question per day) 7-76 ratio
Basic knowledge of PHP language (super detailed)
Idea error running 'application' command line is too long solution
Dynamic programming problem (4)
Dynamic programming problem (VIII)
动态规划问题(七)
What are the skills of API interface optimization?
Dynamic programming (V)
动态规划问题(二)