These fixes are all auto generated and can be merged directly Fixes the following issues 1. Event used on components should be hypenated 2. Attribute orders in components 3. Use `unmounted` instead of `destroyed` 4. Add explicit `emits` declarations for components, autofixed [using this script](https://gist.github.com/scmmishra/6f549109b96400006bb69bbde392eddf) We ignore the top level v-if for now, we will fix it later
64 lines
1.2 KiB
Vue
64 lines
1.2 KiB
Vue
<script>
|
|
export default {
|
|
props: {
|
|
shrink: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
emits: ['expand'],
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="read-more">
|
|
<div
|
|
:class="{
|
|
'shrink-container after:shrink-gradient-light dark:after:shrink-gradient-dark':
|
|
shrink,
|
|
}"
|
|
>
|
|
<slot />
|
|
<woot-button
|
|
v-if="shrink"
|
|
size="tiny"
|
|
variant="smooth"
|
|
color-scheme="primary"
|
|
class="read-more-button"
|
|
@click.prevent="$emit('expand')"
|
|
>
|
|
{{ $t('SEARCH.READ_MORE') }}
|
|
</woot-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
@tailwind components;
|
|
@layer components {
|
|
.shrink-gradient-light {
|
|
background: linear-gradient(
|
|
to bottom,
|
|
rgba(255, 255, 255, 0),
|
|
rgba(255, 255, 255, 1) 100%
|
|
);
|
|
}
|
|
|
|
.shrink-gradient-dark {
|
|
background: linear-gradient(
|
|
to bottom,
|
|
rgba(0, 0, 0, 0),
|
|
rgb(21, 23, 24) 100%
|
|
);
|
|
}
|
|
}
|
|
.shrink-container {
|
|
@apply max-h-[100px] overflow-hidden relative;
|
|
}
|
|
.shrink-container::after {
|
|
}
|
|
.read-more-button {
|
|
@apply max-w-max absolute bottom-2 left-0 right-0 mx-auto mt-0 z-20 shadow-sm;
|
|
}
|
|
</style>
|