Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor 事件在另一个事件后停止工作_Meteor - Fatal编程技术网

Meteor 事件在另一个事件后停止工作

Meteor 事件在另一个事件后停止工作,meteor,Meteor,我有一个带有事件的文本框,它在会话中存储文本框的值,并在页面上显示该值。我有一个带有事件的图像列表,在点击图像后,会在文本框中添加一个图像url。但是,如果在文本框中手动写入某些文本,它将停止处理添加图像事件 代码如下: <template name="imgList"> <div style="width: 500px; height: 100px; overflow: auto;"> {{#each images}}

我有一个带有事件的文本框,它在会话中存储文本框的值,并在页面上显示该值。我有一个带有事件的图像列表,在点击图像后,会在文本框中添加一个图像url。但是,如果在文本框中手动写入某些文本,它将停止处理添加图像事件

代码如下:

<template name="imgList">   
    <div style="width: 500px; height: 100px; overflow: auto;">
        {{#each images}}
            ||<img src="{{this.url}}" class="pic">
        {{/each}}
    </div>
    <textarea class="tbox" cols="50" rows="20"></textarea><br />
    {{#markdown}}{{text}}{{/markdown}}
</template>



Template.imgList.helpers
    images: -> 
        Meteor.Images.find {}, sort: 
            uploadedAt: -1 
    text: ->
        Session.get('text')

Template.imgList.events 
    'keyup .tbox': (evt, temp) ->
        Session.set('text', $('.tbox').val())
    'click .pic': (evt, temp) -> 
        img = evt.target.src
        $(".tbox").append(img)

是否有可能引发一些异常,并阻止代码进一步执行?您在控制台中看到任何日志吗?服务器和客户端上都没有任何错误。