Created
June 24, 2020 12:23
-
-
Save opencoca/f74497f4512bf113826abcf718662eac to your computer and use it in GitHub Desktop.
Subheader @click bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="app"> | |
| <v-app id="inspire"> | |
| <v-layout row> | |
| <v-flex xs12 sm6 offset-sm3> | |
| <v-card> | |
| <v-toolbar color="teal" dark> | |
| <v-toolbar-title>Manage</v-toolbar-title> | |
| <v-spacer></v-spacer> | |
| </v-toolbar> | |
| <v-list> | |
| <template v-for="(item, index) in sidebar"> | |
| <v-list-tile | |
| v-if="item.action" | |
| :key="item.title" | |
| @click="triggerClick(item.click)" | |
| > | |
| <v-list-tile-action> | |
| <v-icon>{{ item.action }}</v-icon> | |
| </v-list-tile-action> | |
| <v-list-tile-content> | |
| <v-list-tile-title>{{ item.title }}</v-list-tile-title> | |
| </v-list-tile-content> | |
| </v-list-tile> | |
| <v-divider | |
| v-else-if="item.divider" | |
| :key="index" | |
| ></v-divider> | |
| <v-subheader | |
| v-else-if="item.header" | |
| :key="item.header" | |
| > | |
| {{ item.header }} | |
| </v-subheader> | |
| </template> | |
| </v-list> | |
| </v-card> | |
| </v-flex> | |
| </v-layout> | |
| </v-app> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| new Vue({ | |
| el: '#app', | |
| data () { | |
| return { | |
| sidebar: [ | |
| { | |
| action: 'move_to_inbox', | |
| title: 'All Items', | |
| click: 1 | |
| }, | |
| { | |
| action: 'send', | |
| title: 'At My Location', | |
| click: 2 | |
| }, | |
| { | |
| action: 'delete', | |
| title: 'In Storage', | |
| click: 3 | |
| }, | |
| { | |
| action: 'report', | |
| title: 'Processiong', | |
| click: 4 | |
| } | |
| ] | |
| } | |
| }, | |
| methods:{ | |
| triggerClick: function (number){ | |
| alert("Clicked!"+number); | |
| } | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/vuetify@1.5.16/dist/vuetify.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet" /> | |
| <link href="https://cdn.jsdelivr.net/npm/vuetify@1.5.16/dist/vuetify.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment