html - HTML 导入每个模块而不是链接导入
问题描述
这是我的电子APP的HTML头。
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="import" href="importInfo.info">
</head>
这是 importInfo.info 文件。
<meta charset="utf-8">
<title>HITS</title>
<script>window.$ = window.jQuery = require('../node_modules/jquery/dist/jquery.min.js');</script>
<link rel="stylesheet" href="../asset/font-awesome/css/font-awesome.min.css">
<script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../node_modules/jquery-ui/external/requirejs/require.js"></script>
<link href="../asset/css/jquery-ui.css" rel="stylesheet">
<link href="../asset/css/style.css" rel="stylesheet">
<script src="../asset/js/frontLib.script"></script>
由于这个错误,我想通过简单的复制和粘贴将其更改为下面的 HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HITS</title>
<script>window.$ = window.jQuery = require('../node_modules/jquery/dist/jquery.min.js');</script>
<link rel="stylesheet" href="../asset/font-awesome/css/font-awesome.min.css">
<script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../node_modules/jquery-ui/external/requirejs/require.js"></script>
<link href="../asset/css/jquery-ui.css" rel="stylesheet">
<link href="../asset/css/style.css" rel="stylesheet">
<script src="../asset/js/frontLib.script"></script>
</head>
我一改变
require.js:166 未捕获的错误:不匹配的匿名定义()模块:函数(){
return _;
}
发生此错误。
我应该怎么办?我可以简单地保留链接 rel="import" 吗???
它说它计划在 2018 年 3 月左右被移除,所以我很害怕,尽管时间已经过去了。
解决方案
推荐阅读
- c# - 错误连接到远程 SQL Server Express 2012 windows 10 c#
- java - 无法从购物车中删除商品
- typo3 - TYPO3 新闻路由无法正常工作。但它在站点地图中显示的 URL 中工作
- typescript - stenciljs 中的缓存破坏 ^2.3.0
- c - 类型转换对 printf 函数的影响
- angular - Team City 中的 Angular 生产构建错误:
- django - django在尝试使用表单时找不到模板
- react-native - 推荐用于 react native 的稳定文本编辑器
- vaadin7 - 从 Vaadin 7 迁移到 Vaadin 8 后不编译项目
- react-native - 如何在本机反应中使用状态?