深圳网站建设流程图,网站开发实用技术第二版答案,百度推广关键词和创意,网站建设业动态scrip标签里加 lang“renderjs” #xff0c;可以使用原生js的dom#xff0c;但是我在使用中发现以下问题#xff0c;导致数据不能动态获取
1. onLoad获取上级页面传值 // APP不会触发#xff0c;h5可以
2. props不会触发
解决办法添加 script 逻辑层数据传入渲染层 ren…scrip标签里加 lang“renderjs” 可以使用原生js的dom但是我在使用中发现以下问题导致数据不能动态获取
1. onLoad获取上级页面传值 // APP不会触发h5可以
2. props不会触发
解决办法添加 script 逻辑层数据传入渲染层 renderjs
templateview classcontent!-- clickezuikit.onClick --view classpreview idvideo-container :propdetail :change:propezuikit.receiveMsg/view/view
/templatescriptimport { 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);// }}};
/scriptscript moduleezuikit langrenderjsimport { monitordetail } from /api/all.jsvar 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.jsscript.onload this.initPlayer.bind(this)document.head.appendChild(script)}},// onClick(event, ownerInstance) {// // 调用 service 层的方法// ownerInstance.callMethod(onViewClick, {// test: test// })// },initPlayer() {}}}
/scriptstyle.content {margin-top: 30%;display: flex;flex-direction: column;align-items: center;justify-content: center;}
/style