wx.miniProgram.navigateTo不起效果
官方文档地址: https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
<span class="token comment">// javascript</span>
wx<span class="token punctuation">.</span>miniProgram<span class="token punctuation">.</span><span class="token function">navigateTo</span><span class="token punctuation">(</span><span class="token punctuation">{</span>url<span class="token operator">:</span> <span class="token string">'<strong>/</strong>pages/index/index'</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
wx<span class="token punctuation">.</span>miniProgram<span class="token punctuation">.</span><span class="token function">postMessage</span><span class="token punctuation">(</span><span class="token punctuation">{</span> data<span class="token operator">:</span> <span class="token string">'foo'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
wx<span class="token punctuation">.</span>miniProgram<span class="token punctuation">.</span><span class="token function">postMessage</span><span class="token punctuation">(</span><span class="token punctuation">{</span> data<span class="token operator">:</span> <span class="token punctuation">{</span>foo<span class="token operator">:</span> <span class="token string">'bar'</span><span class="token punctuation">}</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
wx<span class="token punctuation">.</span>miniProgram<span class="token punctuation">.</span><span class="token function">getEnv</span><span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">res</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>res<span class="token punctuation">.</span>miniprogram<span class="token punctuation">)</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
============ 欢迎各位老板打赏~ ===========
与本文相关的文章
- · 微信小程序防止事件穿透防止事件冒泡
- · 小程序可以绑定其它小程序吗?
- · vue3+vite+多环境发面到二级目录配置
- · 普通链接二维码跳转小程序
- · 解决flex-direction: column 之后元素宽度自动变为100%
- · vue/react/node/vite/npm/yarn build自动更新版本号
- · getVisitDistribution 访问来源定义(访问来源 key 对应关系)
- · TinyMCE工具栏配置详解
- · Ant Design Vue 1.7.8 (vu2)自定义路由菜单图标
- · vue获取节点的父节点、兄弟节点、子节点
- · vue3+vite3实现路由自动化
- · h5吹气互动(利用recorderjs获取输入音量大小)