我在使用Browserify的Backbone构建中使用已编译的下划线模板。当我引用模板并运行我的代码时,我收到错误Uncaught ReferenceError: _ is not defined
,我不完全确定原因,有人可以提出建议吗?
JS
var Backbone = require('backbone'),
$ = require('jquery'),
_ = require('underscore'),
dataStore = require('dataStore'),
FastDOM = require('fastdom');
require('../templates');
module.exports = Backbone.View.extend({
className: 'contact-view view transition-toggle is-hidden',
template: JST['contact.html'],
//...
违反下划线_.escape,Array.prototype.join}with(obj)