v-on =“…”语法在VueJS中是什么意思?

JavaScript Vue.js

番长

2020-04-03

我遇到了v-dialog组件的Vuetify示例,该示例 具有一个称为activator的作用域插槽,定义如下:

  <template v-slot:activator="{ on }">
    <v-btn
      color="red lighten-2"
      dark
      v-on="on"
    >
      Click Me
    </v-btn>
  </template>

我了解了VueJS文档作用域插槽的用途以及解构插槽道具的概念,但我不理解v-on="on"此示例中的含义特别是当未使用v-on指令指定事件时,这意味着什么

The VueJS docs on v-on only shows its usage in combination with event name explicitly specified (eg. v-on:click="...") but there is no explanation of just using it as v-on="...".

Can someone explain this syntax and its usage in the Vuetify example?

第3991篇《v-on =“…”语法在VueJS中是什么意思?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android