Use turnjs in the vue
component as a plug-in for turning books.
First introduce the corresponding jquery
in index.html
, and then in The component is as follows:
import turn from 'jsPath/lib/turn.min'
export default {
mounted() {
this.$nextTick(() => {
$('.flipbook').turn({
width: 922,
height: 600,
elevation: 50,
gradients: true,
autoCenter: true
});
});
}
}
Sequential reference should be no problem, but the turn function cannot be called, and the console reports an error, TypeError: $(...).turn is not a function
.
Has anyone used this plug-in? What? What causes this problem? How to solve it?
It is estimated that it is caused by your quoting jquery. I have had similar problems before when I quoted jquery’s third-party plug-in. Try exposing jquery globally.
main.js in: