Closed LiuYashion closed 7 years ago
ERROR in ReferenceError: constructInsideUrl is not defined
html.js:70 module.exports E:/npm_static/src/pages/index/index/html.js:70:12
html.js:54 Object.
html.js:21 __webpack_require__ E:/npm_static/src/pages/index/index/html.js:21:30
html.js:41 E:/npm_static/src/pages/index/index/html.js:41:18
html.js:44 E:/npm_static/src/pages/index/index/html.js:44:10
index.js:230 HtmlWebpackPlugin.evaluateCompilationResult [npm_static]/[html-webpack-plugin]/index.js:230:26
index.js:115 [npm_static]/[html-webpack-plugin]/index.js:115:21
util.js:16 tryCatcher [npm_static]/[bluebird]/js/release/util.js:16:23
promise.js:510 Promise._settlePromiseFromHandler [npm_static]/[bluebird]/js/release/promise.js:510:31
promise.js:567 Promise._settlePromise [npm_static]/[bluebird]/js/release/promise.js:567:18
你在渲染模板的时候,没把constructInsideUrl
方法作为模板参数传进去吧?
看src/pages/index/login/html.js
// ……
const noJquery = require('withoutJqueryModule');
// ……
const loginBoxHtml = require('./templates/login-box.ejs')({
constructInsideUrl: noJquery.constructInsideUrl,
});
// ……
因为demo里的右侧导航栏是写在公共组件里,自己在学习的时候就想在模板里写一个<%= constructInsideUrl('test/index') %>进行跳转测试,可是总报错: ERROR in ReferenceError: constructInsideUrl is not defined 参照着index-login-html.js写,还是报错,看了一两天.. test目录-src->pages