当前位置:网站首页>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 !
边栏推荐
- The difference between {} and ${}
- Dynamic programming problem (VII)
- Plato farm is expected to further expand its ecosystem through elephant swap
- Installation and use of pnpm
- MySQL transaction (this is enough...)
- PTA (daily question) 7-70 diamond
- @Detailed explanation of the use of transactional annotation
- 1331. 数组序号转换 : 简单模拟题
- Laravel8 middleware realizes simple permission control
- Camera Hal OEM模块 ---- cmr_preview.c
猜你喜欢

MySQL installation and configuration tutorial (super detailed, nanny level)

Okaleido ecological core equity Oka, all in fusion mining mode

PTA (daily question) 7-77 encryption

Laravel8 middleware realizes simple permission control

Application and principle of distributed current limiting redistribution rratelimiter

Still writing a lot of if to judge? A rule executor kills all if judgments in the project

16.偏差、方差、正则化、学习曲线对模型的影响

手把手教你安装Latex(保姆级教程)

Idea connection database

Event extraction and documentation (2018)
随机推荐
vulnhub:SolidState
What does WGet mean
MySQL事务(transaction) (有这篇就足够了..)
What are the skills of API interface optimization?
Oracle实例无法启动的问题如何解决
Summary: the difference between pod and container
Sword finger offer 55 - I. depth of binary tree
#{}和${}的区别
Talk about seven ways to realize asynchronous programming
Immutable x officially opens IMX token pledge detailed IMX pledge introduction optimistic about the development prospect of IMX
还在写大量 if 来判断?一个规则执行器干掉项目中所有的 if 判断...
Introduction and solution of common security vulnerabilities in web system CSRF attack
feign调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
Dynamic programming problem (VIII)
Application and principle of distributed current limiting redistribution rratelimiter
Attack and defense world web master advanced area web_ php_ unserialize
vulnhub:Sar
Applet waterfall flow, upload pictures, simple use of maps
动态规划问题(四)
Laravel8 middleware realizes simple permission control