This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const start = this.currentPage * this.itemsPerPage - this.itemsPerPage; | |
const end = start + this.itemsPerPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computed: { | |
totalPages: function() { | |
return Math.ceil(this.dataAmount / this.itemsPerPage) | |
}, | |
currentContents: function() { | |
// 檢查 Array 的資料是否為空 | |
if (!this.cities || this.cities.length != this.cities.length) { | |
return; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
computed: { | |
totalPages: function() { | |
return Math.ceil(this.dataAmount / this.itemsPerPage) | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods: { | |
changeCurrentPage(pageNumber) { | |
this.currentPage = pageNumber | |
}, | |
parseItemsPerPage() { | |
this.itemsPerPage = +this.itemsPerPage; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data() { | |
return { | |
currentPage: 1, | |
itemsPerPage: 1, | |
dataAmount: 0, | |
cities: [ | |
{ | |
id: 1, | |
name: "Paris" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.main-content { | |
margin-top: 50px; | |
margin-bottom: 50px; | |
position: relative; // here | |
z-index: 0; // here | |
} | |
button { | |
margin-top: 20px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="main-content"> | |
<div class="text"> | |
艾菲爾鐵塔(法語:La Tour Eiffel,也常稱為巴黎鐵塔)是位於法國巴黎第七區、塞納河畔戰神廣場的鐵製鏤空塔,世界著名建築,也是法國文化象徵之一,巴黎城市地標之一,巴黎最高建築物。正式地址為Rue Anatole-France 5號。<br> | |
... | |
</div> | |
<!-- Button trigger modal --> | |
<a href="#secretModal" class="btn btn-primary">鐵塔小祕密</a> | |
<!-- Modal --> | |
<div id="secretModal" class="modal"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.img--bottom { | |
margin-top: -100px; | |
// here | |
position: relative; | |
z-index: 0; | |
// end here | |
float: right; | |
transform: rotate(180deg); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text { | |
padding: 15px; | |
border-radius: 10px; | |
position: relative; | |
z-index: 1; // here | |
background-color: #67595E; | |
color: white; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.img--bottom { | |
margin-top: -100px; | |
float: right; | |
transform: rotate(180deg); // add here | |
} |