Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-09-14 13:41:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b53cb4315c86598f1d0bb508974ac2b5c62060a5
b53cb431
1 parent
35daee4d
fix 多行文本组件,只读模式下默认值替换换行符
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
src/components/TextareaField/index.vue
src/components/TextareaField/index.vue
View file @
b53cb43
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-0
8-12 17:37:58
* @LastEditTime: 2024-0
9-14 13:40:21
* @FilePath: /data-table/src/components/TextareaField/index.vue
* @Description: 多行文本输入框
-->
...
...
@@ -17,9 +17,7 @@
v-html="item.component_props.note"
style="font-size: 0.9rem; margin-left: 1rem; color: gray; padding-bottom: 0.5rem; padding-top: 0.25rem; white-space: pre-wrap;"
/>
<div v-if="item.component_props.readonly" style="padding: 0.5rem 1rem; font-size: 0.9rem;">
{{ item.value }}
</div>
<div v-if="item.component_props.readonly" style="padding: 0.5rem 1rem; font-size: 0.9rem; text-align: justify;" v-html="item.value"></div>
<van-field
v-else
v-model="item.value"
...
...
@@ -57,7 +55,8 @@ const ReadonlyShow = computed(() => {
});
onMounted(() => {
props.item.value = props.item.component_props.default;
// 只读模式下默认值替换换行符
props.item.value = item.component_props.readonly ? props.item.component_props.default?.replace(/\n/g, "<br>") : props.item.component_props.default;
})
</script>
...
...
Please
register
or
login
to post a comment