结尾
正式学习前端大概 3 年多了,很早就想整理这个书单了,因为常常会有朋友问,前端该如何学习,学习前端该看哪些书,我就讲讲我学习的道路中看的一些书,虽然整理的书不多,但是每一本都是那种看一本就秒不绝口的感觉。
以下大部分是我看过的,或者说身边的人推荐的书籍,每一本我都有些相关的推荐语,如果你有看到更好的书欢迎推荐呀。
开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】
});
setTimeout(() => {
this.calculateText();
}, 0);
};
},
methods: {
// 计算文字 显示展开 收起
calculateText() {
// 获取一行文字的height 计算当前文字比较列表文字
let oneHeight = this.$refs.more.scrollHeight;
let twoHeight = oneHeight * 2 || 40;
this.textHeight = ${twoHeight}px
;
let txtDom = this.$refs.textContainer;
for (let i = 0; i < txtDom.length; i++) {
let curHeight = txtDom[i].offsetHeight;
if (curHeight > twoHeight) {
this.$set(
this.historyList,
i,
Object.assign({}, this.historyList[i], { status: true })
);
} else {
this.$set(
this.historyList,
i,
Object.assign({}, this.historyList[i], { status: null })
);
}
}
},
more(index) {
this.historyList[index].status = !this.historyList[index].status;
},
},
};
less、vue-cli3.0
class=“text2”
ref=“textContainer2”
:class=“{ retract2: testObj }”
:style=“{ ‘max-height’: testObj ? textHeight2 : ‘’ }”
{{ name }}
<span v-if=“testObj” class=“link2” @click=“moreBtn()”>