diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-23 15:32:44 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-23 15:32:44 +1100 |
| commit | 96a4967d775a60beb5937e1ddee53ae35b4bbec0 (patch) | |
| tree | 3fe8aba9f2c9527e8615e5a02a5bbad734a9d76d /src/components/ParentBarTile.vue | |
| parent | 82ab31777a7cc02461f0b23f9d9550a2baf71f73 (diff) | |
Add basic ParentBar and ParentBarTile components
Diffstat (limited to 'src/components/ParentBarTile.vue')
| -rw-r--r-- | src/components/ParentBarTile.vue | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/components/ParentBarTile.vue b/src/components/ParentBarTile.vue new file mode 100644 index 0000000..7e17ba6 --- /dev/null +++ b/src/components/ParentBarTile.vue @@ -0,0 +1,40 @@ +<script lang="ts"> +import {defineComponent, PropType} from 'vue'; +import {LayoutNode} from '../lib'; + +export default defineComponent({ + props: { + layoutNode: {type: Object as PropType<LayoutNode>, required: true}, + tileSz: {type: Number, required: true}, //px (length of tile edge) + }, + computed: { + styles(): Record<string,string> { + return { + border: '1px black solid', + width: this.tileSz + 'px', + height: this.tileSz + 'px', + minWidth: this.tileSz + 'px', + minHeight: this.tileSz + 'px', + backgroundImage: 'url(\'/img/' + this.layoutNode.tolNode.name.replaceAll('\'', '\\\'') + '.png\')', + backgroundSize: 'cover', + borderRadius: '5px', + }; + }, + headerStyles(): Record<string,string> { + return { + color: 'greenyellow', + // For ellipsis + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + }; + }, + }, +}); +</script> + +<template> + <div :style="styles"> + <div :style="headerStyles">{{layoutNode.tolNode.name}}</div> + </div> +</template> |
