[F] Dynamically update width with js
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
<!-- Course list -->
|
<!-- Course list -->
|
||||||
<el-col :span="8" class="overall-span">
|
<el-col :span="8" class="overall-span">
|
||||||
<el-card id="course-list" class="large right">
|
<el-card id="course-list" ref="cl" class="large right">
|
||||||
<div class="header">
|
<div class="header" :style="{width: courseListWidth + 'px'}">
|
||||||
<div class="text">Course List</div>
|
<div class="text">Course List</div>
|
||||||
|
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
@@ -54,6 +54,8 @@
|
|||||||
directory: any[] = []
|
directory: any[] = []
|
||||||
loading = true
|
loading = true
|
||||||
|
|
||||||
|
courseListWidth: number = 10;
|
||||||
|
|
||||||
created()
|
created()
|
||||||
{
|
{
|
||||||
// Get courses
|
// Get courses
|
||||||
@@ -73,6 +75,12 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updated()
|
||||||
|
{
|
||||||
|
console.log(this.$refs);
|
||||||
|
this.courseListWidth = (<Vue> this.$refs.cl).$el.clientWidth - 20;
|
||||||
|
}
|
||||||
|
|
||||||
get filteredCourses()
|
get filteredCourses()
|
||||||
{
|
{
|
||||||
return this.courseInfo.filter(c => c.name.toLowerCase().includes(this.search))
|
return this.courseInfo.filter(c => c.name.toLowerCase().includes(this.search))
|
||||||
@@ -110,6 +118,7 @@
|
|||||||
{
|
{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
.text
|
.text
|
||||||
{
|
{
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
|
|||||||
Reference in New Issue
Block a user