| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <template>
- <v-app>
- <v-app-bar
- app
- color="white"
- elevate-on-scroll
- >
- <v-app-bar-nav-icon @click.stop="drawer = !drawer"/>
- <v-toolbar-title><strong>JVVM</strong></v-toolbar-title>
- </v-app-bar>
- <v-content>
- </v-content>
- <v-navigation-drawer
- v-model="drawer"
- app
- >
- <v-list subheader>
- <v-subheader>Java</v-subheader>
- <v-list-item link>
- <v-list-item-action>
- <v-icon>mdi-code</v-icon>
- </v-list-item-action>
- <v-list-item-content>
- <v-list-item-title>Home</v-list-item-title>
- </v-list-item-content>
- </v-list-item>
- <v-list-item link>
- <v-list-item-action>
- <v-icon>mdi-mail</v-icon>
- </v-list-item-action>
- <v-list-item-content>
- <v-list-item-title>Contact</v-list-item-title>
- </v-list-item-content>
- </v-list-item>
- </v-list>
- </v-navigation-drawer>
- <v-content class="pt-0">
- <v-container fluid>
- <j-v-v-m :state="currentState" :current-state-index="currentStateIndex"
- :total-state-length="states.length" @onNextFrame="handleNextFrame"
- @onPreFrame="handlePreFrame"
- ></j-v-v-m>
- </v-container>
- </v-content>
- </v-app>
- </template>
- <script>
- import JVVM from '@/views/JVVM'
- export default {
- name: 'App',
- components: { JVVM },
- data () {
- return {
- drawer: false,
- states: [],
- currentStateIndex: 0,
- currentState: {}
- }
- },
- mounted () {
- import('@/assets/jvm-data/out1.json').then(states => {
- const dataList = states.default
- if (dataList && dataList.length > 0) {
- this.currentState = dataList[0]
- }
- this.states = states
- })
- },
- methods: {
- handleNextFrame() {
- if (this.currentStateIndex < this.states.length - 1) {
- this.currentState = this.states[this.currentStateIndex + 1]
- this.currentStateIndex++
- }
- },
- handlePreFrame() {
- if (this.currentStateIndex > 0) {
- this.currentState = this.states[this.currentStateIndex - 1]
- this.currentStateIndex--
- }
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|