草庐IT

bind_result

全部标签

javascript - 'v-bind' 指令需要一个属性值

我正在尝试使用vue.js创建某种类型的树,但遇到了元素Prop的问题。请帮帮我。我试过:content="{{tempCont}}"我试过content="{{tempCont}}",但都没有成功了。这是我使用tree元素的地方:这是整个树元素:{{title}}exportdefault{data:{childVisibility:false},methods:{openTree:function(){childVisibility=!childVisibility;}},props:{title:String,content:Array,}}我收到此错误:

javascript - 无法使用带有解析存在 View 模型的 ko.mapping.fromJSON 解析绑定(bind) js 错误

我想以JSON格式将View模型保存在隐藏字段中。一切正常。但是当我尝试获取它时-我得到错误:UncaughtError:Unabletoparsebindings.Message:ReferenceError:selectAllisnotdefined;Bindingsvalue:checked:AllCheck,click:selectAllJsFiddlerView模型functionAppViewModel(){//Weekthis.AllCheck=ko.observable(false);this.DaysOfWeekResult=ko.observableArray();

javascript - 当textarea绑定(bind)到模型时angularjs中的默认textarea值

HTML:最初禁止原因是空的。但是我想提供一个默认值。但是reason不起作用。有什么办法吗? 最佳答案 在您的Controller中,您可以执行以下操作:$scope.user={ban_reason:"reason"} 关于javascript-当textarea绑定(bind)到模型时angularjs中的默认textarea值,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions

javascript - 使用 ControllerAs 语法的 Firebase 3 向数据绑定(bind)

我正在尝试使用firebase和angularfire进行三向数据绑定(bind)。你可以看到我在Plunker中得到了什么:http://plnkr.co/edit/RGA4jZK3Y6n4RkPCHK37app.js:angular.module('ideaBattle',["firebase"]);服务:angular.module('ideaBattle').constant('FBURL','https://ideabattle.firebaseio.com/').service('Ref',['FBURL',Firebase]).factory('dataBank',fun

javascript - 将更改事件绑定(bind)到 jquery 中的输入字段组

我有如下三个输入字段:我怎样才能像这样一次将onChange事件添加到所有这些字段:$("selecttheelementswithidaddress,city,country").bind("change",function(){//dosomething}); 最佳答案 如@Rory所说,在id选择器中使用,或为所有这些添加一个类并调用更改函数$('.className').bind("change",function(){//yourstuff});然而因为它是一个输入字段..我建议你使用..keyup(),使用change你

javascript - knockoutjs 勾选数据绑定(bind)调用函数

我需要做以下事情:当用户选中复选框时,会调用一些函数。在模型中:varviewModel={this.someFunction=function(){console.log("1");}};我还没有找到任何有关此文档的信息here. 最佳答案 您需要的是clickbinding:在你的View模型中:varViewModel=function(data,event){this.someFunction=function(){console.log(event.target.checked);//logoutthecurrentsta

javascript - knockout.js 绑定(bind) bootstrap btn-group

我想知道是否可以将Twitterbootstrapradiobtn-group中的选定值绑定(bind)到knockout.js中的可观察值?在我的例子中,我像这样将组绑定(bind)到一个observableArray${Description}有什么指导吗?干杯,弗加尔。 最佳答案 这是一个如何做到这一点的例子:http://jsfiddle.net/jearles/vu8pk/通过使用css绑定(bind),我们可以根据为每个按钮选择的可观察对象动态打开/关闭“事件”类。 关于ja

javascript - 如何将 socket.io(在 nodejs 中)的事件处理程序绑定(bind)到我自己的范围?

我在我的nodejs服务器中使用“socket.io”。有没有办法在我的类/模块(在浏览器中)的范围内运行已注册的事件函数?...init:function(){this.socket=newio.Socket('localhost:3000');//connecttolocalhostpresentlythis.socket.on('connect',this.myConnect);},myConnect:function(){//"this.socket"and"this.f"areunknown//this.socket.send({});//this.f();},f:funct

Javascript:绑定(bind)到函数的右侧?

如何绑定(bind)到函数的右边?示例:varsquare=Math.pow.bindRight(2);console.log(square(3));//desiredoutput:9 最佳答案 Function.prototype.bindRight=function(){varself=this,args=[].slice.call(arguments);returnfunction(){returnself.apply(this,[].slice.call(arguments).concat(args));};};varsqu

javascript - knockout template - 将文本绑定(bind)到函数,并传入模板数据

我有一个带有可观察数组的View模型。它填充了一些json:this.socialTiles=ko.observableArray([]);ko.computed(function(){jQuery.getJSON(this.apiURL+"&callback=?",function(data){vartheData=data.entries;tilesModel.socialTiles(theData);console.dir(theData);});},tilesModel);对于模型中的每个项目,我使用模板构建一个li:5minutesagoid喜欢将元素的文本数据绑定(bind