javascript - Edge 不允许 vue.js 作为 asp.net MVC 的模块工作
问题描述
我创建了一个最能代表我的设置的最小复制:
_emptyLayout.cshtml
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon"
type="image/png"
href="/Content/images/favicon.ico" />
<title>@ViewBag.Title</title>
</head>
<body>
@RenderBody()
</body>
</html>
数据控制器.cs
[Authorize(Users = "DataReader")]
public class DataController : Controller
{
public ActionResult windex()
{
return View();
}
public ActionResult Index()
{
return View();
}
}
windows.cshtml
@{
ViewBag.Title = "windex";
Layout = "~/Views/Shared/_emptyLayout.cshtml";
}
<h2>windex</h2>
<div id="app">
{{msg}}
</div>
<script src="~/Scripts/data.js" type="module"></script>
数据.js
import Vue from 'https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.esm.browser.js'
export default new Vue(
{
el: '#app',
data: {msg:'hi there'}
});
基本上,当 Edge 呈现页面时,我会看到“{{msg}}”。当 Firefox 呈现页面时,我看到“你好”。
没有错误消息或警告。
纯 html 页面似乎不存在该问题。例如,我尝试使用堆栈片段复制问题,但 Edge 显示“你好”。
此外,如果我不使用模块,只使用常规脚本标签,它在 Edge 中也能很好地呈现。
以前有没有人遇到过这种技术组合的问题?有没有办法解决它?
解决方案
推荐阅读
- performance - 对不同长度向量进行逐元素求和的更快方法是什么?
- regex - 匹配以字符开头的行的多次出现
- python - 删除以注释字符开头的 pandas 数据框中的项目
- python - 对字典值的操作没有输出
- c++ - OpenGL:屏幕空间环境光遮蔽 (SSAO)
- tensorflow - conda 安装 tensorflow
- java - 如何使用 HttpClient 5 使 Conscrypt SSL 提供程序在 Tomcat Web 应用程序中工作
- mysql - [42000][1064] SQL 错误:无法在 DataGrip 中执行新表。
- python - Python 的 sys.stdout.buffer.write() 在 Linux 上增加了额外的 0x0d
- python-3.x - Keras Xception 模型输入形状混淆