add ui-text component with max-lines
This commit is contained in:
@@ -125,7 +125,7 @@ namespace zero.Core.Database
|
||||
QueryParameters = parameters
|
||||
}, new QueryOperationOptions { AllowStale = true });
|
||||
|
||||
Operation operation = await GetOperationExecutor(database).SendAsync(operationQuery);
|
||||
Operation operation = await GetOperationExecutor(database ?? ResolvedDatabase).SendAsync(operationQuery);
|
||||
|
||||
await operation.WaitForCompletionAsync();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ import uiPermissions from './permissions.vue';
|
||||
import uiRevisions from './revisions.vue';
|
||||
import uiIcon from './icon.vue';
|
||||
import uiLocalize from './localize.vue';
|
||||
import uiText from './text.vue';
|
||||
|
||||
import uiEditor from '../editor/editor.vue';
|
||||
import uiEditorInfos from '../editor/editor-infos.vue';
|
||||
@@ -135,6 +136,7 @@ export default {
|
||||
uiRevisions,
|
||||
uiIcon,
|
||||
uiLocalize,
|
||||
uiText,
|
||||
|
||||
uiEditor,
|
||||
uiEditorInfos
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div class="ui-text" @click="opened = !opened" :class="{ 'is-open': opened }" :style="{'-webkit-line-clamp': maxLines > 0 ? maxLines : null }"><slot></slot></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'uiText',
|
||||
|
||||
props: {
|
||||
maxLines: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
|
||||
data: () => ({
|
||||
opened: false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.ui-text
|
||||
{
|
||||
line-height: 1.5;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
|
||||
&.is-open
|
||||
{
|
||||
-webkit-line-clamp: inherit !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user