您的位置:首页 > 教育 > 锐评 > 管理咨询公司需要的能力_合肥网页设计培训班_泰安网站优化公司_夫唯seo怎么样

管理咨询公司需要的能力_合肥网页设计培训班_泰安网站优化公司_夫唯seo怎么样

2025/2/24 23:29:45 来源:https://blog.csdn.net/weixin_45811884/article/details/143230197  浏览:    关键词:管理咨询公司需要的能力_合肥网页设计培训班_泰安网站优化公司_夫唯seo怎么样
管理咨询公司需要的能力_合肥网页设计培训班_泰安网站优化公司_夫唯seo怎么样

scrip标签里加 lang=“renderjs” ,可以使用原生js的dom,但是我在使用中发现以下问题,导致数据不能动态获取

1. onLoad获取上级页面传值 // APP不会触发,h5可以

2. props不会触发

解决办法添加 script 逻辑层数据传入渲染层 renderjs

<template><view class="content"><!-- @click="ezuikit.onClick" --><view class="preview" id="video-container" :prop="detail" :change:prop="ezuikit.receiveMsg"></view></view>
</template><script>import { monitordetail } from "@/api/all.js" // 获取数据的接口export default {data() {return {detail: { },};},created() {monitordetail({monitorId: uni.getStorageSync('monitorId')}).then(res=>{this.detail = {token: res.data.accessToken,url: res.data.url}})},methods: {// // 接收renderjs发回的数据// onViewClick(val) {// 	console.log('receiveRenderData-->', val);// }}};
</script><script module="ezuikit" lang="renderjs">import { monitordetail } from "@/api/all.js"var player = null;export default {data() {return {getData:{}}},mounted() {},methods: {// 接收逻辑层发送的数据receiveMsg(newValue, oldValue, ownerVm, vm) {// console.log('newValue', newValue)// console.log('oldValue', oldValue)this.getData = newValueif (typeof window.EZUIKit !== 'undefined') {this.initPlayer();} else {// 动态引入较大类库避免影响页面展示const script = document.createElement('script')// view 层的页面运行在 www 根目录,其相对路径相对于 www 计算script.src = 'static/ezuikit.js'script.onload = this.initPlayer.bind(this)document.head.appendChild(script)}},// onClick(event, ownerInstance) {// 	// 调用 service 层的方法// 	ownerInstance.callMethod('onViewClick', {// 		test: 'test'// 	})// },initPlayer() {}}}
</script><style>.content {margin-top: 30%;display: flex;flex-direction: column;align-items: center;justify-content: center;}
</style>

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com