kp97338
kp97338

Reputation: 29

how to call vuejs function from seperate javascript function

I am trying to call vuejs function from external javascript function,but its not calling, I have given below the code which i am trying.

//below is my vuejs code vu.js

            Ut = {
                    data: function() {
                    },
                    methods: {
                        show() {
                            alert("Succes");
                        }
                    }
                } 

//below is my seperate js file ext.js

  function call(){
            show()
           }

Upvotes: 0

Views: 63

Answers (1)

Vanishdark
Vanishdark

Reputation: 170

You need to import your vue component to your ext.js file

import Vu from '../vu'

function call(){
 Vu.show()
}

Upvotes: 1

Related Questions