Vue method called when clicking on component elementHow do I detect a click outside an element?HTML “overlay” which allows clicks to fall through to elements behind itPure JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for itReact functional stateless component, PureComponent, Component; what are the differences and when should we use what?VueJS - How to call event on child component from parent v-forVue 2 Component not calling main instance functionHow to save reference to “this” in Vue component?Vue :click is being triggered automatically inside v-forVue js - making a style to be inherited by children componentsAccess to DOM element with Vue method

Inverse-quotes-quine

Why is Madam Hooch not a professor?

Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?

Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?

How come I was asked by a CBP officer why I was in the US?

What are the penalties for overstaying in USA?

Is this one of the engines from the 9/11 aircraft?

How to determine what is the correct level of detail when modelling?

Why is C++ initial allocation so much larger than C's?

When is it ok to add filler to a story?

Why cruise at 7000' in an A319?

What's the difference between 予定 (Yotei) and 計画 (keikaku)?

How well known and how commonly used was Huffman coding in 1979?

Going to get married soon, should I do it on Dec 31 or Jan 1?

How could mana leakage be dangerous to a elf?

Does anycast addressing add additional latency in any way?

Should I include salary information on my CV?

Are neural networks the wrong tool to solve this 2D platformer/shooter game? Is there a proven way to frame this problem to a neural network?

Should my manager be aware of private LinkedIn approaches I receive? How to politely have this happen?

How can Charles Proxy change settings without admin rights after first time?

Does the posterior necessarily follow the same conditional dependence structure as the prior?

Using “sparkling” as a diminutive of “spark” in a poem

Singing along to guitar chords (harmony)

How dangerous are set-size assumptions?



Vue method called when clicking on component element


How do I detect a click outside an element?HTML “overlay” which allows clicks to fall through to elements behind itPure JavaScript equivalent of jQuery's $.ready() - how to call a function when the page/DOM is ready for itReact functional stateless component, PureComponent, Component; what are the differences and when should we use what?VueJS - How to call event on child component from parent v-forVue 2 Component not calling main instance functionHow to save reference to “this” in Vue component?Vue :click is being triggered automatically inside v-forVue js - making a style to be inherited by children componentsAccess to DOM element with Vue method






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Strange behavior, I have function called sum.

This functions should be called once (after getting data from the server, and it's what happening)
but then it's getting called every time I click on other elements in the component...it could be even select element or date selector...everything that have v-model defined (I think)



What I'm missing here?



Thanks!



<td><span>_sum('device')</span></td>


** important : this td element is not defined inside loop.



Call stack is the same as when the data is returning from the server










share|improve this question






















  • Why are you calling a function from the expression? Why don't you use computed properties?

    – varit05
    Mar 25 at 11:13











  • @varit05 cause I'm getting error "TypeError: _vm._sum is not a function"

    – Avib
    Mar 25 at 11:48


















0















Strange behavior, I have function called sum.

This functions should be called once (after getting data from the server, and it's what happening)
but then it's getting called every time I click on other elements in the component...it could be even select element or date selector...everything that have v-model defined (I think)



What I'm missing here?



Thanks!



<td><span>_sum('device')</span></td>


** important : this td element is not defined inside loop.



Call stack is the same as when the data is returning from the server










share|improve this question






















  • Why are you calling a function from the expression? Why don't you use computed properties?

    – varit05
    Mar 25 at 11:13











  • @varit05 cause I'm getting error "TypeError: _vm._sum is not a function"

    – Avib
    Mar 25 at 11:48














0












0








0








Strange behavior, I have function called sum.

This functions should be called once (after getting data from the server, and it's what happening)
but then it's getting called every time I click on other elements in the component...it could be even select element or date selector...everything that have v-model defined (I think)



What I'm missing here?



Thanks!



<td><span>_sum('device')</span></td>


** important : this td element is not defined inside loop.



Call stack is the same as when the data is returning from the server










share|improve this question














Strange behavior, I have function called sum.

This functions should be called once (after getting data from the server, and it's what happening)
but then it's getting called every time I click on other elements in the component...it could be even select element or date selector...everything that have v-model defined (I think)



What I'm missing here?



Thanks!



<td><span>_sum('device')</span></td>


** important : this td element is not defined inside loop.



Call stack is the same as when the data is returning from the server







javascript vue.js vuejs2






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 11:00









AvibAvib

288 bronze badges




288 bronze badges












  • Why are you calling a function from the expression? Why don't you use computed properties?

    – varit05
    Mar 25 at 11:13











  • @varit05 cause I'm getting error "TypeError: _vm._sum is not a function"

    – Avib
    Mar 25 at 11:48


















  • Why are you calling a function from the expression? Why don't you use computed properties?

    – varit05
    Mar 25 at 11:13











  • @varit05 cause I'm getting error "TypeError: _vm._sum is not a function"

    – Avib
    Mar 25 at 11:48

















Why are you calling a function from the expression? Why don't you use computed properties?

– varit05
Mar 25 at 11:13





Why are you calling a function from the expression? Why don't you use computed properties?

– varit05
Mar 25 at 11:13













@varit05 cause I'm getting error "TypeError: _vm._sum is not a function"

– Avib
Mar 25 at 11:48






@varit05 cause I'm getting error "TypeError: _vm._sum is not a function"

– Avib
Mar 25 at 11:48













1 Answer
1






active

oldest

votes


















0














Ok, got it...the solution is to attach the main object
(the one who responsible for the table data) to a watch property.
Now only when the table items getting an update the function will execute.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336305%2fvue-method-called-when-clicking-on-component-element%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Ok, got it...the solution is to attach the main object
    (the one who responsible for the table data) to a watch property.
    Now only when the table items getting an update the function will execute.






    share|improve this answer



























      0














      Ok, got it...the solution is to attach the main object
      (the one who responsible for the table data) to a watch property.
      Now only when the table items getting an update the function will execute.






      share|improve this answer

























        0












        0








        0







        Ok, got it...the solution is to attach the main object
        (the one who responsible for the table data) to a watch property.
        Now only when the table items getting an update the function will execute.






        share|improve this answer













        Ok, got it...the solution is to attach the main object
        (the one who responsible for the table data) to a watch property.
        Now only when the table items getting an update the function will execute.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 12:43









        AvibAvib

        288 bronze badges




        288 bronze badges





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid …


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336305%2fvue-method-called-when-clicking-on-component-element%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh