web-page.nvue
<web-view class="hhh" src="/hybrid/html/local.html" @message="getMessage"></web-view>
local.html
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>本地网页</title>
</head>
<body>
<p class="desc" style="color: #00AAFF;">web-view 组件加载本地 html 示例,仅在 App 环境下生效。点击下列按钮,跳转至其它页面。</p>
<script type="text/javascript">
alert('web-view 组件加载本地 html 示例,仅在 App 环境下生效')//无效
console.log('web-view 组件加载本地 html 示例,仅在 App 环境下生效')//无效
</script>
</body>
</html>
2 个回复
大图APP (作者) - 金刚狼前端
难道加载的本地html页面 不支持 javascript了吗????
DCloud_iOS_XHY
感谢反馈, nvue 页面的 web-view 组件暂时不支持在HX中同步输出log,页面中的 js 代码其实已经执行了, alert 没有显示的问题确认为 bug,下个版本会修复