Skip to content

Commit

Permalink
fix: the contents inside pre tag will not be wrapped (tiny-craft#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed Jun 28, 2024
1 parent 908d4c7 commit e2093a8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/content_value/ContentValueHash.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const valueColumn = computed(() => ({
// },
render: (row) => {
if (isCode.value) {
return h('pre', {}, row.dv || row.v)
return h('pre', { class: 'pre-wrap' }, row.dv || row.v)
}
if (row.rm === true) {
return h('s', {}, row.dv || row.v)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/content_value/ContentValueList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const valueColumn = computed(() => ({
},
render: (row) => {
if (isCode.value) {
return h('pre', {}, row.dv || row.v)
return h('pre', { class: 'pre-wrap' }, row.dv || row.v)
}
return row.dv || row.v
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/content_value/ContentValueSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const valueColumn = computed(() => ({
},
render: (row) => {
if (isCode.value) {
return h('pre', {}, row.dv || row.v)
return h('pre', { class: 'pre-wrap' }, row.dv || row.v)
}
return row.dv || row.v
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const valueColumn = computed(() => ({
},
// sorter: (row1, row2) => row1.value - row2.value,
render: (row) => {
return h('pre', {}, row.dv)
return h('pre', { class: 'pre-wrap' }, row.dv)
},
}))
const actionColumn = {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/content_value/ContentValueZSet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const valueColumn = computed(() => ({
// sorter: (row1, row2) => row1.value - row2.value,
render: (row) => {
if (isCode.value) {
return h('pre', {}, row.dv || row.v)
return h('pre', { class: 'pre-wrap' }, row.dv || row.v)
}
return row.dv || row.v
},
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/styles/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ body {
animation: rotate 2s linear infinite;
}

.pre-wrap {
white-space: pre-wrap;
}

@keyframes rotate {
100% {
transform: rotate(360deg);
Expand Down

0 comments on commit e2093a8

Please sign in to comment.