define(['avalon', 'text!./td.button.html'], function(avalon, template) {
	var _interface = function () {
	};
	avalon.component("td:button", {
		//外部参数
		value: '',
		badge: '',
		type: 'default',  //default, primary, success, info, warning, danger
		size: 'normal',   //large, mormal, small, xsmall
		pull: '',
		disabled: false,
		isAction: false,
		onclicked: null,
		actions: [],
		//view接口
		toggleAction: _interface,
		doClick: _interface,
		doAction: _interface,
		//默认配置
		$template: template,
		$construct: function (hooks, vmOpts, elemOpts) {
			var options = avalon.mix(hooks, vmOpts, elemOpts);
			return options; //返回VM的定义对象
		},
		$dispose: function (vm, elem) {
			elem.innerHTML = elem.textContent = '';
		},
		$init: function(vm, elem) {
			vm.toggleAction = function(ev) {
				if(!vm.disabled) {
					vm.isAction = !vm.isAction;
				}
			}
			vm.doClick = function(ev) {
				if(typeof vm.onclicked == 'function' && !vm.disabled) {
					vm.onclicked(ev, vm);
				}
			}
			vm.doAction = function(ev, fun) {
				if(typeof fun == 'function') {
					fun(ev, vm);
				}
				vm.isAction = !vm.isAction;
			}
		},
		$ready: function (vm) {
      
    }
	});
	
	var widget = avalon.components["td:button"];
  widget.regionals = {};
});
@@ -1112,16 +1112,135 @@
 n;%0A%09%09%09%7D%0A
+%09%09%09//%E5%AF%B9%E5%A4%96%E6%96%B9%E6%B3%95%0A%09%09%09vm.click = function() %7B%0A%09%09%09%09if(!vm.disabled) %7B%0A%09%09%09%09%09elem.getElementsByTagName('a')%5B0%5D.click();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A
 %09%09%7D,%0A%09%09$

add click