| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <div class="jvvm">
- <source-code class="source-code"></source-code>
- <j-v-m-code v-if="state.currentFrame" class="j-v-m-code" :code="state.currentFrame.code"></j-v-m-code>
- <j-frame class="current-frame" name="current frame" :frame="state.currentFrame"></j-frame>
- <j-frame class="optional-frame" name="optional frame" :frame="state.optionalNextFrame"></j-frame>
- <memory v-if="state.memory" class="memory">
- <memory-object :key="name" :object="value" v-for="(value, name) in state.memory.objects" class="object"></memory-object>
- </memory>
- <div class="actions">
- <v-btn class="mx-2" fab dark small color="#5a6a7a" @click="goPreFrame">
- <v-icon dark>mdi-arrow-left</v-icon>
- </v-btn>
- <v-btn class="mx-2" fab dark small color="#5a6a7a" @click="goNextFrame">
- <v-icon dark>mdi-arrow-right</v-icon>
- </v-btn>
- </div>
- </div>
- </template>
- <script>
- import JVMCode from '@/components/JVMCode'
- import SourceCode from '@/components/SourceCode'
- import JFrame from '@/components/JFrame'
- import Memory from '@/components/Memory'
- import MemoryObject from '@/components/MemoryObject'
- export default {
- name: 'JVVM',
- components: {
- MemoryObject,
- Memory,
- JFrame,
- SourceCode,
- JVMCode
- },
- props: {
- state: {
- default: () => ({ currentFrame: { code: [] }, optionalNextFrame: {}, memory: { objects: [] } }),
- type: Object
- },
- currentStateIndex: {
- default: 0,
- type: Number
- },
- totalStateLength: {
- default: 0,
- type: Number
- }
- },
- methods: {
- goNextFrame () {
- this.$emit('onNextFrame')
- },
- goPreFrame () {
- this.$emit('onPreFrame')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .actions {
- position: fixed;
- right: 12px;
- bottom: 24px;
- }
- .jvvm {
- display: grid;
- grid-gap: 24px;
- }
- @media (min-width: 720px) {
- .source-code {
- grid-area: source;
- max-height: calc(100vh - 90px);
- overflow: auto;
- }
- .j-v-m-code {
- grid-area: jvm-code;
- max-height: calc(100vh - 90px);
- overflow: auto;
- }
- .current-frame {
- grid-area: current-frame;
- min-height: calc(50vh - 70px);
- overflow: auto;
- }
- .optional-frame {
- grid-area: optional-frame;
- min-height: calc(50vh - 70px);
- overflow: auto;
- }
- .memory {
- grid-area: memory;
- max-height: calc(50vh - 44px);
- overflow: auto;
- }
- .jvvm {
- display: grid;
- position: relative;
- grid-gap: 24px;
- grid-template-columns: 1.3fr 1.3fr 1fr 1fr;
- grid-template-areas: 'source jvm-code current-frame optional-frame' 'source jvm-code memory memory' 'source jvm-code memory memory';
- }
- .actions {
- position: absolute;
- left: 12px;
- bottom: 24px;
- }
- }
- </style>
|