zhouzhuojie / meteor-vue

Vue for Meteor
130 stars 8 forks source link

Deleting from vue model does not delete from collection #7

Open ramstein74 opened 9 years ago

ramstein74 commented 9 years ago

hi i have this in my model sync: { 'data3': function() { return Posts.find(); }

and in my html li v-repeat="post: data3" v-on="click:data3.$remove($index)"

when i click the record is gone from the page but remains in the collection.

Isnt "sync" suppose to sync ?

thank you

zhouzhuojie commented 9 years ago

Hi @ramstein74, please refer to https://github.com/zhouzhuojie/meteor-vue/issues/2 Actually sync is one way, from Meteor db to view only. We need you to write your own update function to touch the db. It's more secure and flexible to do that.

ramstein74 commented 9 years ago

Sorry to hear that. You should add that notice to the docs. Also sync is not the best word. Call it "Get" Regards

xkjyeah commented 9 years ago

@ramstein74 You should be deleting from the underlying data source, i.e. Posts.remove(...)