-
-
{{ childPost.title }}
-
-
-
-
{{ childPost.content }}
-
+
+
+
{{ childPost.title }}
+
+
+
{{ childPost.content }}
+
+
\ No newline at end of file
+
diff --git a/src/components/CustomCalendar.js b/src/components/CustomCalendar.js
index 425fc56..138c6d6 100644
--- a/src/components/CustomCalendar.js
+++ b/src/components/CustomCalendar.js
@@ -1,21 +1,19 @@
-
-
-const weekDayNumber = 7;
-const week_zh_cn = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
-const week_en_us = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
+const weekDayNumber = 7
+const week_zh_cn = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
+const week_en_us = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
class Day {
- constructor(year, month, day, content, isCurrentMonth = false, isCurrentDay = false) {
- this.year = year;
- this.month = month;
- this.day = day;
- this.content = content;
- this.isCurrentMonth = isCurrentMonth;
- this.isCurrentDay = isCurrentDay
- }
+ constructor(year, month, day, content, isCurrentMonth = false, isCurrentDay = false) {
+ this.year = year
+ this.month = month
+ this.day = day
+ this.content = content
+ this.isCurrentMonth = isCurrentMonth
+ this.isCurrentDay = isCurrentDay
+ }
}
-const defaultDate = new Date();
+const defaultDate = new Date()
const defaultYear = defaultDate.getFullYear()
const defaultMonth = defaultDate.getMonth()
const defaultDay = defaultDate.getDate()
@@ -24,58 +22,52 @@ const defaultDay = defaultDate.getDate()
* 初始化日历
* @param {[Day]} currentDays
* @param {number} [year = defaultYear]
- * @param {number} [month = defaultMonth]
- * @param {number} [day = defaultDay]
+ * @param {number} [month = defaultMonth]
+ * @param {number} [day = defaultDay]
* @returns {[Day]}
*/
-function initDay(currentDays = new Array(42), year = defaultYear, month = defaultMonth, day = defaultDay) {
+function initDay(
+ currentDays = new Array(42),
+ year = defaultYear,
+ month = defaultMonth,
+ day = defaultDay
+) {
+ if (!Array.isArray(currentDays)) {
+ currentDays = new Array(42)
+ } else if (currentDays.length !== 42) {
+ console.log(currentDays)
+ throw new Error('currentDays:' + currentDays)
+ } else {
+ currentDays = [...currentDays]
+ }
- if (!Array.isArray(currentDays)) {
- currentDays = new Array(42);
- } else if (currentDays.length != 42) {
- console.log(currentDays);
- throw new Error(currentDays)
- } else {
- currentDays = [...currentDays];
+ const days = currentDays
+ const lastDayOfLastMonth = new Date(year, month, 0)
+ const firstDayOfMonth = new Date(year, month, 1)
+ const lastDayOfMonth = new Date(year, month + 1, 0)
+ const currentDaysOfMonth = lastDayOfMonth.getDate()
+ const daysOfLastMonth = lastDayOfLastMonth.getDate()
+
+ for (let i = 0; i < firstDayOfMonth.getDay(); i++) {
+ const weekDay = firstDayOfMonth.getDay() - 1
+ days[i] = new Day(year, month - 1, daysOfLastMonth - weekDay + i, week_zh_cn[i])
+ }
+
+ for (let i = 0; i < currentDaysOfMonth; i++) {
+ const weekDay = (firstDayOfMonth.getDay() + i) % weekDayNumber
+ days[firstDayOfMonth.getDay() + i] = new Day(year, month, i + 1, week_zh_cn[weekDay], true)
+ if (i === day - 1) {
+ days[firstDayOfMonth.getDay() + i].isCurrentDay = true
}
+ }
- const days = currentDays;
- const lastDayOfLastMonth = new Date(year, month, 0);
- const firstDayOfMonth = new Date(year, month, 1);
- const lastDayOfMonth = new Date(year, month + 1, 0);
- const currentDaysOfMonth = lastDayOfMonth.getDate();
- const daysOfLastMonth = lastDayOfLastMonth.getDate();
+ for (let i = currentDaysOfMonth + firstDayOfMonth.getDay(); i < days.length; i++) {
+ const extraDay = i - currentDaysOfMonth - firstDayOfMonth.getDay() + 1
+ const weekDay = i % weekDayNumber
+ days[i] = new Day(year, month + 1, extraDay, week_zh_cn[weekDay])
+ }
- for (let i = 0; i < firstDayOfMonth.getDay(); i++) {
- const weekDay = firstDayOfMonth.getDay() - 1;
- days[i] = new Day(year, month - 1, daysOfLastMonth - weekDay + i, week_zh_cn[i]);
- }
-
- for (let i = 0; i < currentDaysOfMonth; i++) {
- const weekDay = (firstDayOfMonth.getDay() + i) % weekDayNumber;
- days[firstDayOfMonth.getDay() + i] = new Day(year, month, i + 1, week_zh_cn[weekDay], true);
- if (i === day - 1) {
- days[firstDayOfMonth.getDay() + i].isCurrentDay = true;
- }
- }
-
- for (let i = currentDaysOfMonth + firstDayOfMonth.getDay(); i < days.length; i++) {
- const extraDay = i - currentDaysOfMonth - firstDayOfMonth.getDay() + 1;
- const weekDay = i % weekDayNumber;
- days[i] = new Day(year, month + 1, extraDay, week_zh_cn[weekDay]);
- }
-
- return currentDays;
+ return currentDays
}
-export { week_zh_cn, week_en_us, defaultYear, defaultMonth, defaultDay, initDay };
-
-
-
-
-
-
-
-
-
-
+export { week_zh_cn, week_en_us, defaultYear, defaultMonth, defaultDay, initDay }
diff --git a/src/components/CustomCalendar.vue b/src/components/CustomCalendar.vue
index 1c70180..b0c8608 100644
--- a/src/components/CustomCalendar.vue
+++ b/src/components/CustomCalendar.vue
@@ -14,11 +14,21 @@ const day = ref(defaultDay)
const editMonth = {
add: () => {
- month.value >= 11 ? ((month.value = 0), (year.value += 1)) : (month.value += 1)
+ if (month.value >= 11) {
+ month.value = 0
+ year.value += 1
+ } else {
+ month.value += 1
+ }
dayArray.value = initDay(dayArray.value, year.value, month.value, day.value)
},
sub: () => {
- month.value <= 0 ? ((month.value = 11), (year.value -= 1)) : (month.value -= 1)
+ if (month.value <= 0) {
+ month.value = 11
+ year.value -= 1
+ } else {
+ month.value -= 1
+ }
dayArray.value = initDay(dayArray.value, year.value, month.value, day.value)
}
}
@@ -73,8 +83,10 @@ const handleDayClick = (date) => {
justify-content: space-around;
width: 100%;
}
+
text-align: center;
}
+
#calendar .title {
> button {
height: 20px;
@@ -89,6 +101,7 @@ const handleDayClick = (date) => {
.content {
display: grid;
grid-template-columns: repeat(7, 1fr);
+
> div {
outline: 1px solid;
display: flex;
@@ -103,6 +116,7 @@ const handleDayClick = (date) => {
#calendar {
width: 280px;
}
+
.content {
height: 240px;
}
@@ -112,6 +126,7 @@ const handleDayClick = (date) => {
#calendar {
max-width: 350px;
}
+
.content {
height: 300px;
}
diff --git a/src/components/CustomPoem.vue b/src/components/CustomPoem.vue
index eb0f102..fa40998 100644
--- a/src/components/CustomPoem.vue
+++ b/src/components/CustomPoem.vue
@@ -1,83 +1,83 @@
-
-
-
- {{ this.poemTitle }}
-
-
-
+
\ No newline at end of file
+
+@keyframes fadeIn {
+ to {
+ opacity: 1;
+ }
+}
+
diff --git a/src/components/PersonInfo.vue b/src/components/PersonInfo.vue
deleted file mode 100644
index 0708e9b..0000000
--- a/src/components/PersonInfo.vue
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- PersonInfoHHHHH
-
-
-
-
\ No newline at end of file
diff --git a/src/components/TestApi.vue b/src/components/TestApi.vue
index 7620fb7..89e2c23 100644
--- a/src/components/TestApi.vue
+++ b/src/components/TestApi.vue
@@ -1,36 +1,36 @@
-
-
- {{ this.test[0].name }}
- {{ this.test[0].birth }}
- {{ this.test[0].gender }}
- {{ this.test[0].name }}
- {{ this.test[0].password }}
- {{ this.test[0].register_date }}
- {{ this.test[0].status }}
-
+
+
+ {{ this.test[0].name }}
+ {{ this.test[0].birth }}
+ {{ this.test[0].gender }}
+ {{ this.test[0].name }}
+ {{ this.test[0].password }}
+ {{ this.test[0].register_date }}
+ {{ this.test[0].status }}
+
-
\ No newline at end of file
+
diff --git a/src/components/XiaoMiLogin.vue b/src/components/XiaoMiLogin.vue
index 3cfd7d6..0426fb4 100644
--- a/src/components/XiaoMiLogin.vue
+++ b/src/components/XiaoMiLogin.vue
@@ -1,340 +1,346 @@
-