有人可以解释一下,当我点击(×)时,为什么(引导程序)警报会关闭:
let bookshelf = require('./base');
var Vehicle,
Vehicles;
Vehicle = bookshelf.Model.extend({
tableName: 'vehicles',
/**
* Insert a model based on data
* @param {Object} data
* @param {Object} [options] Options for model.save
* @return {Promise(bookshelf.Model)}
*/
create: function (data, options) {
return this.forge(data).save(null, options);
},
/**
* Select a model based on a query
* @param {Object} [query]
* @param {Object} [options] Options for model.fetch
* @param {Boolean} [options.require=false]
* @return {Promise(bookshelf.Model)}
*/
findOne: function (query, options) {
options = extend({ require: true }, options);
return this.forge(query).fetch(options);
},
/**
* Select a model based on data and update if found, insert if not found
* @param {Object} selectData Data for select
* @param {Object} updateData Data for update
* @param {Object} [options] Options for model.save
*/
upsert: function (selectData, updateData, options) {
return this.findOne(selectData, extend(options, { require: false }))
.bind(this)
.then(function (model) {
return model
? model.save(
updateData,
extend({ patch: true, method: 'update' }, options)
)
: this.create(
extend(selectData, updateData),
extend(options, { method: 'insert' })
)
});
}
});
Vehicles = bookshelf.Collection.extend({
model: Vehicle
});
module.exports = {
Vehicle: bookshelf.model('Vehicle', Vehicle),
Vehicles: bookshelf.collection('Vehicles', Vehicles)
};
答案 0 :(得分:1)
Bootstrap还有一个处理此类行为的JS部分。您甚至可以在docs中找到有关此内容的部分。
答案 1 :(得分:0)
(×)
是关闭提醒的按钮。如果您不想使用此功能,则可以从data-dismiss="alert"
代码中删除a
。