vue.js里面使用jquery

144 阅读1分钟

实现的需求就是单选按钮点击取消,在数据加载之后执行,写的方法就是 $().ready(function(){ //do something })

	$().ready(function(){
	$("input:radio").click(function(){
			var checkedState = $(this).attr('checked');//记录当前选中状态
			console.log(checkedState)
			$(this).attr('checked',true);//2.
			if(checkedState == 'checked'){
				$(this).attr('checked',false); //3.
			}
		});
})