Official way to call a method from outside the view model.
See original GitHub issueI’m trying to integrate Vue into a Backbone.js app. What is the official way for outside code to call a method in Vue? Is it something like:
// inside the Backbone.View
this.vue = new Vue({ methods: { myFunc : function(){} } } );
this.vue.methods.myFunc.call(this.vue);
Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Reactions:6
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Knockout.js calling method outside of view model
If you want to call a method of your view model from the outside, just make an instance: var userModel = new userHealthModel();...
Read more >How to call function OUTSIDE of viewModel from a ko ...
I have a fairly complicated viewModel that is mapped using ko.mapping from a JSON object. This works: <span data-bind="text: decTotalPrice"></ ...
Read more >How to call a method from another class - Apple Developer
I want to call my hideBirthFrameOutlet2 method from outside my ViewController1 class. I want to call it from within ViewController2 from within this...
Read more >Calling a Method of a Control in the View, from the ViewModel
1) In MVVM if you use ViewModel first technology you simply create and hold the Main Views handle from the ViewModel. Simply do...
Read more >Laravel view models - Stitcher.io
For example, you can pass a view model directly to the view function if the view model implements Arrayable . public function create()...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can just do
this.vue.myFunc()
. All methods are present on the created vm.would it be possible to expose a vue method from a component? so far i can only do as long as the method is within the vue instance creation, but i suppose that it would be possible from a component as well?