Authored by 姜枫

handle merge

... ... @@ -95,7 +95,7 @@ $(function() {
// 运行此demo
// 1. 安装 npm i -g json-server
// 2. json-server --watch mock/address.json
cascadingAddress({
window.add = cascadingAddress({
el: '#address',
url: 'http://localhost:3000/areas/0',
resource: 'areas'
... ...
... ... @@ -34,4 +34,8 @@
dist: '320102' // 区县
});
重置地址:
address.reset();
开发者: 董金虎
... ...
... ... @@ -439,6 +439,19 @@ CascadingAddress.prototype.setAddress = function(targetAddr) {
}
};
// 重置地址
CascadingAddress.prototype.reset = function() {
var items = $(this.config.el).find('.items-indicator'),
labels = this.config.indicators;
items.each(function(index, item) {
$(item).find('span.indicator-name').text(labels[index])
.next().val('')
.parent().next()
.find('span.checked').removeClass('checked').prev().hide();
});
};
module.exports = function(options) {
return new CascadingAddress(options);
};
... ...