Vuejs methods how to use

Posted Jamy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vuejs methods how to use相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-if、v-else、v-show</title>
    <script src="../js/vue.js"></script>
    <!--copy from http://vuejs.org.cn/guide/-->
</head>
<body>
    <div id="app">
        <p v-if="willShow">显示</p>
        <p v-else>隐藏</p>
        <button @click="fn()">改变</button>
    </div>
    <script>
        var vm=new Vue({ el:"#app", data:{ willShow:true }, methods:{ fn:function(){ if(this.willShow==true){ this.willShow=false; }else{ this.willShow=true } } } }); </script>
</body>
</html>

以上是关于Vuejs methods how to use的主要内容,如果未能解决你的问题,请参考以下文章

How to receive JSON as an MVC 5 action method parameter

How to suppress 'Maybe this is program method' warnings from ProGuard

how-to-add-a-breakpoint-in-a-managed-generic-method-in-windbg-sos

Java中使用HttpRequest调用RESTfull的DELETE方法接口提示:How to fix HTTP method DELETE doesn't support output

How to Install The Alpha Control Packages.

Dapper: How to get return value ( output value) by call stored procedure