Skip to content

Commit e4c6bc3

Browse files
committed
fix: cleaning up layouts
1 parent d226b3b commit e4c6bc3

5 files changed

Lines changed: 19 additions & 27 deletions

File tree

layouts/side-title.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
<script setup lang="ts">
2-
import { computed, useSlots } from 'vue'
1+
<script setup lang="js">
2+
import { computed } from 'vue'
33
import { compute_alignment, compute_column_size } from '../layoutHelper'
44
5-
const slots = useSlots()
6-
75
const props = defineProps({
86
side: {
97
default: 'l',
@@ -55,15 +53,15 @@ const colorscheme = computed(() => {
5553
<p>
5654
There are three parameters: <code>color</code>, <code>columns</code> and <code>align</code>. Currently:
5755
<code>color: {{ props.color }}</code
58-
>, <code>columns: {{ props.columns }}</code> and <code>align: {{ props.align }}</code
56+
>, <code>columns: {{ props.titlewidth }}</code> and <code>align: {{ props.align }}</code
5957
>.
6058
</p>
6159
<p>The "slots" of the page are default and <code>:: content ::</code></p>
6260
<p>
63-
Options for <code>columns</code> are divided into 12 column units. So with <code>columns: is-1-11</code> the left
64-
column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only specifying
65-
the left column (<code>columns: is-1</code> does the same thing). In addition there are short hands like
66-
<code>columns: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
61+
Options for <code>titlewidth</code> are divided into 12 column units. So with <code>titlewidth: is-1-11</code> the
62+
left column is 1/12 wide and the the right columns is 11/12 wide. The component admits a short had of only
63+
specifying the left column (<code>titlewidth: is-1</code> does the same thing). In addition there are short hands
64+
like <code>titlewidth: is-one-quarter</code> which resolves to <code>is-3-9</code>, etc...
6765
</p>
6866
<p>
6967
Here are a bunch of examples:

layouts/top-title-two-cols.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
<script setup lang="ts">
2-
import { computed, useSlots } from 'vue'
1+
<script setup lang="js">
2+
import { computed } from 'vue'
33
import { compute_alignment, compute_column_size } from '../layoutHelper'
44
5-
const slots = useSlots()
6-
75
const props = defineProps({
86
columns: {
97
default: 'is-one-half',
@@ -59,7 +57,7 @@ const colorscheme = computed(() => {
5957

6058
<p>The <code>color</code> parameter determines color of the title.</p>
6159
</div>
62-
<template v-else>
60+
<div v-else>
6361
<div class="flex flex-col h-full w-full">
6462
<div class="w-full h-fit min-h-13 pt-2 pb-2 slidecolor" :class="colorscheme">
6563
<div class="slidev-layout toptitle title p-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment.t">
@@ -80,7 +78,7 @@ const colorscheme = computed(() => {
8078
<slot name="default" />
8179
</div>
8280
</div>
83-
</template>
81+
</div>
8482
</template>
8583

8684
<style>

layouts/top-title.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
<script setup lang="ts">
2-
import { computed, useSlots } from 'vue'
3-
import { compute_alignment, compute_column_size } from '../layoutHelper'
4-
5-
const slots = useSlots()
1+
<script setup lang="js">
2+
import { computed } from 'vue'
3+
import { compute_alignment } from '../layoutHelper'
64
75
const props = defineProps({
86
color: {
@@ -41,7 +39,7 @@ const colorscheme = computed(() => {
4139

4240
<p>The <code>color</code> parameter determines color of the title.</p>
4341
</div>
44-
<template v-else>
42+
<div v-else>
4543
<div class="flex flex-col h-full w-full">
4644
<div class="w-full h-fit min-h-13 pt-2 pb-2 slidecolor" :class="colorscheme">
4745
<div class="slidev-layout toptitle title p-0 pt-0 ml-6 mr-6 mt-auto mb-auto" :class="alignment">
@@ -55,7 +53,7 @@ const colorscheme = computed(() => {
5553
<slot name="default" />
5654
</div>
5755
</div>
58-
</template>
56+
</div>
5957
</template>
6058

6159
<style>

layouts/two-cols-title.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<script setup lang="ts">
1+
<script setup lang="js">
22
import { computed, useSlots } from 'vue'
33
import { compute_alignment, compute_column_size } from '../layoutHelper'
44

layouts/two-cols.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
<script setup lang="ts">
2-
import { computed, useSlots } from 'vue'
1+
<script setup lang="js">
2+
import { computed } from 'vue'
33
import { compute_alignment, compute_column_size } from '../layoutHelper'
44
5-
const slots = useSlots()
6-
75
const props = defineProps({
86
columns: {
97
default: 'is-one-half',

0 commit comments

Comments
 (0)