Skip to content

Commit

Permalink
fix: textarea 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Ymm0008 committed Jan 17, 2023
1 parent 585dbe0 commit d8e11a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/packages/__VUE/textarea/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@
top: -999999px;
left: -999999px;
font-size: 14px;
line-height: 1.5;
font-family: monospace;
}
}
6 changes: 4 additions & 2 deletions src/packages/__VUE/textarea/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default create({
};

const textareaRef = ref<any>(null);
const textareaHeight = ref();
const textareaHeight = ref(20);
const heightSet = ref('auto');
const getContentHeight = () => {
heightSet.value = 'auto';
Expand Down Expand Up @@ -216,7 +216,9 @@ export default create({
if (res[0] && textareaRef.value) {
let _item: any = Array.from(res[0]).filter((item: any) => item.id == uid);
if (_item[0]) {
textareaHeight.value = _item[0]['height'] || 20;
if (Taro.getEnv() !== Taro.ENV_TYPE.WEAPP) {
textareaHeight.value = _item[0]['height'] || 20;
}
copyTxtStyle.value.width = _item[0]['width'] + 'px';
}
nextTick(getContentHeight);
Expand Down

0 comments on commit d8e11a8

Please sign in to comment.