Events in vue2

< template >
< div class= "topic" >

 

  <a href="/" @click.native="get()">btn</a>
     <li><a @click="fn()"></a></li>
     <button @click="post()">btn</button>

< / div >
< / template >

< script >

export default {
    data() {
        return {
        }
    },
    methods: {
        get() {
            console.log("ggggg")
        },
        fn() {
            alert("");
        },
        post() {
            alert("");
        }
    }
}

< / script >

< style lang= "scss" scoped >
< / style >

clipboard.png

vue

clipboard.png

clipboard.png

Mar.01,2021

what do you mean @ click? does adding a native involve native methods?
and your annotated code must not work


this is fine. You can refresh or recompile

.
<template>
  <div class="user">
    <div class="user-name" @click="fn()">
      <div></div>
      
    </div>
  </div>
</template>
<script>

  export default {
    name: "barTop",
    data() {
      return {
        isShow: false
      }
    },
    mounted() {
    },
    created() {

    },
    methods: {
      fn(){
        console.log('aaa')
      }

    }
  }
</script>

<style scoped lang="less">
  @import url('./barTop.less');
</style>


<h2 @click="fn()">fuck</h2>

used uncivilized words and was crabbed by webpack


Thank you very much for your answer: css's problem has been solved. Thank you

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bde670-313df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bde670-313df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?