trim "get classes"
This commit is contained in:
parent
a715e761a9
commit
641492339a
1 changed files with 1 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<rect
|
<rect
|
||||||
:class="classes"
|
:class="focused ? 'focus' : ''"
|
||||||
:x="rectangle.left"
|
:x="rectangle.left"
|
||||||
:y="rectangle.top"
|
:y="rectangle.top"
|
||||||
:width="rectangle.width"
|
:width="rectangle.width"
|
||||||
|
@ -24,16 +24,6 @@ import { Rectangle } from "./rectangles";
|
||||||
export default class Rect extends Vue {
|
export default class Rect extends Vue {
|
||||||
private focused!: boolean;
|
private focused!: boolean;
|
||||||
private rectangle!: Rectangle;
|
private rectangle!: Rectangle;
|
||||||
|
|
||||||
private get classes(): string {
|
|
||||||
let result: string[] = [];
|
|
||||||
|
|
||||||
if (this.focused) {
|
|
||||||
result.push("focus");
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.join(" ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue