关于firebug:Element实现动态表格的示例代码

【代码背景】【代码实现】 1# -> 代码复用的根底是你须要一个可复用的组件2# -> 在展现页面应用动静表格组件3# -> 如何给动静表格依据需要动静增加序号列/索引列【代码背景】有这样一个业务需要场景,有大略十几张表归属于某个类别,用户心愿在同一个页面,通过抉择不同的查问指标展现不同的表格,这些表的表头款式相似然而又不完全相同,怎么做呢? 到目前为止所有基于Element UI的表格款式都是间接在页面写死的,像官网这样: <el-table :data="tableData" style="width: 100%"> <el-table-column prop="date" label="日期" width="180"></el-table-column><el-table-column prop="name" label="姓名" width="180"></el-table-column><el-table-column prop="address" label="地址"></el-table-column></el-table>要解决上述问题,最简略暴力的形式是为每个表写一个独自组件,而后通过select框触发事件切换不同组件路由渲染页面,当然这种形式很笨,也不合乎代码复用的根本准则,所以为了偷懒,为了坚守代码复用的根本准则,开始思考有没有更好的形式来解决这个问题。 仔细观察这个<el-table>,表格数据是通过:data绑定的,表格头部数据则是通过<el-table-column>标签展现的,表头数据是不是也能够通过某种传参的形式联合v-for来渲染<el-table-column>的具体数据呢?在度娘的帮忙下,果然有大佬曾经这样做了,实现了动静表格,参考链接挂在最底下了哦,在此特别感谢收费分享常识的大佬们,常识无价,学无止境。 现将本我的项目的具体实现代码记录如下,欠缺了一些代码的注解,尝试帮忙了解。 【代码实现】 1# -> 代码复用的根底是你须要一个可复用的组件在/components/Table文件夹下新建两个组件 DynamicTable.vue <template> <!-- 动静展现表格 --> <el-table :data="tableData" border stripe :height="height" @row-click="handleRowClick"> <!-- v-for 循环取表头数据 --><template v-for="item in tableHeader"> <table-column v-if="item.children && item.children.length" :key="item.id" :column-header="item" /> <el-table-column v-else :key="item.id" :label="item.label" :prop="item.prop" align="center" /></template></el-table></template><script> import TableColumn from '@/components/Table/TableColumn' export default { name: 'DynamicTable',components: { TableColumn},props: { // 表格的数据 tableData: { type: Array, required: true }, // 多级表头的数据 tableHeader: { type: Array, required: true }, // 表格的高度 height: { type: String, default: '300' }},methods: { // 行点击事件 handleRowClick (row, column, event) { // console.log(row) // console.log(column) // console.log(event) // 告诉调用父组件的row-click事件 // row作为参数传递过来 this.$emit('row-click', row) }}}</script>TableColumn.vue ...

August 30, 2021 · 2 min · jiezi

关于firebug:解讲5CCGD003W-3D-Graphics

5CCGD003W: 3D Graphics ProgrammingCoursework 1 – 2D Game (2020/21)Module leader Dr Anastassia AngelopoulouUnit Coursework 1 – REFERRED/DEFERREDWeighting: 40%Qualifying mark 30%Description 2D Game or GUI applicationLearning OutcomesCovered in thisAssignment:This assignment contributes towards the following LearningOutcomes (LOs):▪ LO1 Use appropriate data structures for storing vertices,faces and edges that define the shape of objects andmanipulate such objects by applying differenttransformations;▪ LO2 Be able to design and implement 2D real-timescenes that respond to user interaction;▪ LO5 Be able to critically assess the current problems andappreciate some of solutions available through practicalexercises and demonstrate knowledge and appreciationof some research related issues in computer graphics;▪ LO6 Communicate and present ideas by oral, visual andwritten meansHanded Out: 09/06/2021Due Date 06/07/2021 at 13:00Expected deliverables cpp file(s)Method ofSubmission:Electronic submission on BBType of Feedback andDue Date:Formative feedback will be provided during tutorial sessions.Verbal feedback on the submitted CW will be provided duringthe CW presentation/viva. Students are encouraged to recordthis feedback at this time.Note: All marks will remain provisional until formally agreed byan Assessment Board.3D Graphics Programming - Coursework One - Referred/Deferred 5CCGD003W2 @Dr Anastassia AngelopoulouAssessment regulationsRefer to Student Handbook guide for undergraduate students for a clarification ofhow you are assessed, penalties and late submissions, what constitutes plagiarismetc.Penalty for Late SubmissionIf you submit your coursework late but within 24 hours or one working day of thespecified deadline, 10 marks will be deducted from the final mark, as a penalty forlate submission, except for work which obtains a mark in the range 40 – 49%, inwhich case the mark will be capped at the pass mark (40%). If you submit yourcoursework more than 24 hours or more than one working day after the specifieddeadline you will be given a mark of zero for the work in question unless a claim ofMitigating Circumstances has been submitted and accepted as valid.It is recognised that on occasion, illness or a personal crisis can mean that you fail tosubmit a piece of work on time. In such cases you must inform the Campus Office inwriting on a mitigating circumstances form, giving the reason for your late or nonsubmission.You must provide relevant documentary evidence with the form. Thisinformation will be reported to the relevant Assessment Board that will decidewhether the mark of zero shall stand. For more detailed information regardingUniversity Assessment Regulations, please refer to the followingwebsite:BCS Criteria meeting inthis assignment:2.1.1 Knowledge and understanding of facts, concepts, principles& theories2.1.5 Deploy theory in design, implementation and evaluation ofsystems2.1.8 Knowledge of management techniques to achieveobjectives2.2.1 Specify, design or construct computer-based systems2.2.4 Deploy tools effectively2.3.2 Development of general transferable skills4.1.2 Knowledge and understanding of mathematical andstatistical principles4.1.3 Knowledge and understanding of computational modelling4.2.1 Specify, deploy, verify and maintain computer-basedsystems3D Graphics Programming - Coursework One - Referred/Deferred 5CCGD003W3 @Dr Anastassia AngelopoulouCoursework OneNotes:1) In order to pass the referred coursework significant improvements over anypreviously submitted version must be demonstrated.2) You MUST attend a viva – this is part of the assessment. No viva – MAXIMUMmark of 30%3) For referred cws only, in the viva you need to explain the improvements youhave made to previous submitted versions.This coursework is worth 40% of the total module mark.Please read carefully and read all sections. Raise any issues about this courseworkearly with your lecturer/tutor. Also see additional support code on the Blackboardsite for the module under Assessment.Learning Outcomes: ...

June 14, 2021 · 13 min · jiezi