课程学习,目录,笔记样式,根据内容自动控制高度

This commit is contained in:
daihh
2022-10-17 21:13:14 +08:00
parent 967f0953de
commit 97cf914727
4 changed files with 77 additions and 32 deletions

View File

@@ -13,7 +13,7 @@
<img :src="`${webBaseUrl}/images/cotedetel.png`" @click="timeDel()" />
</div>
<div class="newcote-text">
<el-input type="textarea" :autofocus="true" placeholder="好记性不如烂笔头,记录些什么吧~"
<el-input type="textarea" :autofocus="true" :style="`min-height:${inputHeight}px`" placeholder="好记性不如烂笔头,记录些什么吧~"
v-model="content_new" maxlength="200" :autosize="{ minRows: 8, maxRows: 20}"
show-word-limit>
</el-input>
@@ -21,7 +21,7 @@
</div>
<!-- 我的笔记 -->
<div v-if="notetab == 2">
<div class="mycote-content" v-show="!isEdit">
<div class="mycote-content" v-show="!isEdit" :style="`height:${inputHeight+100}px`">
<div v-if="noteList.length > 0">
<div style="border-bottom:1px solid #4444;padding-bottom:25px;" v-for="note in noteList"
:key="note.id">
@@ -105,8 +105,12 @@ import { testType, correctJudgment, numberToLetter } from '@/utils/tools.js';
export default {
props: {
data: {
type: Object,
default: () => { }
type: Object,
default: () => { }
},
height:{
type: Number,
default: 200
},
score: {
type:Number,
@@ -118,6 +122,7 @@ export default {
return {
inAnimationText:'笔记保存成功U币+2',
isEdit:false,
inputHeight:168,
courseId:'',
inAnimation: false,
btnPlayTime:false,//是否显示添加视频时间
@@ -150,12 +155,20 @@ export default {
},
watch: {
//内容的高度
height(val){
this.inputHeight=(val-182);
//console.log(this.inputHeight,'this.inputHeight');
if(this.inputHeight>500){
this.inputHeight=500;
}
},
selected:{
handler(val,old){
this.$emit('change',this.selected)
},
deep:true
},
handler(val,old){
this.$emit('change',this.selected)
},
deep:true
},
data(val){
if(val.id) {
console.log(val,'val');
@@ -170,8 +183,8 @@ export default {
},
methods: {
handleClick(){
this.$emit('change',this.selected)
},
this.$emit('change',this.selected)
},
onPlayVideo(conId,time) {
//这里应该加上内容的id
this.$emit('onPlayVideo',conId,time);
@@ -497,8 +510,8 @@ export default {
}
.mycote-dibu {
margin: 50px 38%;
margin: 50px 50px;
text-align: center;
color: #999999;
font-size: 14px;
}