我试图在{{#各}}周围插入<div>
容器,但它也不起作用。这也很奇怪,因为它适用于2个普通的帖子列表页面,但不适用于按距离排序的第三个页面。
更新:注意到,当我将模板JS从template.name.onRendered
更改为onCreated
后,排序页面就可以工作了。但是,只有当您从上一篇文章列表页面,而不是从概要文件页面时,它才能工作。
错误页的唯一共同点是那些使用publishComposite进行排序的页面。既然publishComposite有一个孩子和父母的关系,这会是个问题吗?
错误消息
Exception in queued task: Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
at Error (native)
at Object.container._uihooks.insertElement (http://localhost:3000/packages/meteoric_ionic.js?e45c114e85716d9fad8bac1cd7904ae2700bc963:5750:19)
at DOMRange._insertNodeWithHooks (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:383:21)
at Function.Blaze._DOMRange._insertNodeWithHooks (http://localhost:3000/packages/peerlibrary_blaze-components.js?4eddb4e3f0f660190548347e680d109a51a7050f:2377:10)
at Function.DOMRange._insert (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:354:16)
at DOMRange.attach (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:431:16)
at Blaze._DOMRange.attach (http://localhost:3000/packages/peerlibrary_blaze-components.js?4eddb4e3f0f660190548347e680d109a51a7050f:2437:33)
at Function.DOMRange._insert (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:349:7)
at DOMRange.attach (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:431:16)
at Blaze._DOMRange.attach (http://localhost:3000/packages/peerlibrary_blaze-components.js?4eddb4e3f0f660190548347e680d109a51a7050f:2437:33)
引用第19行的meteoric_ionic js文件
container._uihooks = {
insertElement: function(node, next) {
var $node = $(node);
if (!template.transition || !$node.hasClass('view') || IonNavigation.skipTransitions) {
container.insertBefore(node, next); //line 19
return;
}
相关的html
{{#ionView}}
{{#ionContent}}
{{#ionList}}
<div>
{{#each shops}}
{{> shopItem}}
{{/each}}
</div>
{{/ionList}}
{{/ionContent}}
{{/ionView}}
发布于 2016-02-11 00:34:19
试试这个,让我知道:
Template.nearShops.onCreated(function () {
var self = this;
self.autorun(function () {
self.interval = Meteor.setInterval(function(){
var currentLocation = Geolocation.latLng() || '';
if(currentLocation) {
Session.set('lat', currentLocation.lat);
Session.set('lng', currentLocation.lng);
}
}, 2000);
});
self.autorun(function(){
if(Session.get('lat')) {
self.subscribe( "nearShops", Session.get('lng'), Session.get('lat') );
}
});
});
如果这件事起作用,我会解释的
发布于 2021-01-26 16:17:14
我通过更新第9版到第11版的cdk来修正它。
我的案例:将mat卡(CdkDrag)嵌入到mat-网格列表(CdkDropListGroup)/mat-网格-瓷砖中。
提醒‘未能在’节点‘上执行'insertBefore’:要插入新节点的节点不是该节点的子节点。
https://stackoverflow.com/questions/35017820
复制相似问题