只有h5可以使用,app端无法使用
具体问题如下图
核心代码
<script module="turn" lang="renderjs">
export default {
data() {
return {
//jQuery:null
};
},
mounted() {
//this.init()
},
methods: {
thisUpdata(newdata,old,x){
//console.log(1);
console.log(newdata,old);
this.$nextTick(()=>{
this.init()
})
},
init() {
if (typeof window.turn === 'object') {
this.creatRJS()
} else {
const script = document.createElement('script')
script.src = '../../static/js/turn.js'
script.onload = this.creatRJS.bind(this)
document.head.appendChild(script)
}
},
creatRJS() {
let w = document.body.clientWidth;
let h = document.body.clientHeight;
console.log($("#flipbook"));
$("#flipbook").turn({
display: 'single',
width: w,
height: h,
// Elevation
elevation: 1,
animating: true,
// Enable gradients
gradients: true,
autoCenter: true,
acceleration: true,
when: {
turning: (event, page, pageObject) => {
console.log(page);
}
}
});
}
}
}
</script>
3***@qq.com (作者)
感谢,APP端地址不一样
2021-04-09 09:05