Home>Article>Web Front-end> Let’s talk about how vue2.x + turn.js achieves the book turning effect
vue2.x turn.js How to achieve the book turning effect? The following article will introduce to you how to use turn.js in vue2.x and achieve the book flipping effect. I hope it will be helpful to you.
Preview of the effect:
Official website download source code: http://turnjs.com/
Find the file lib/turn.js
Put it in the newly created utils file
Turn.js is written using jquery. When using vue, jquery must be introduced
npm install --save jquery
Create new vue.config.js configuration file
const webpack = require('webpack') module.exports = { chainWebpack: config => { //引入ProvidePlugin config.plugin("provide").use(webpack.ProvidePlugin, [{ $: "jquery", jquery: "jquery", jQuery: "jquery", "window.jQuery": "jquery", }, ]); }, }
I introduced the official file into the local image file and used
to view the pixels of the file when setting the width and height. width is 2 times height unchanged.
Use vue file content
Effect picture:
[Related recommendations:vue.js tutorial】
The above is the detailed content of Let’s talk about how vue2.x + turn.js achieves the book turning effect. For more information, please follow other related articles on the PHP Chinese website!