3***@qq.com
3***@qq.com
  • 发布:2021-04-08 17:11
  • 更新:2021-04-09 00:26
  • 阅读:1307

renderjs引入了外部js 只有h5可以使用,app端却无法使用

分类:uni-app

只有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>
2021-04-08 17:11 负责人:无 分享
已邀请:
陌上华年

陌上华年

是JS文件没引对吧?
试试加载网络地址的?

  • 3***@qq.com (作者)

    感谢,APP端地址不一样

    2021-04-09 09:05

3***@qq.com

3***@qq.com (作者)

如有修复方法,可前往码云地址https://gitee.com/laoshirenzt/novel-uniapp.git留言,我看到后将升级您为开发者。

该问题目前已经被锁定, 无法添加新回复