Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
bump version 0.1.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
staugur committed Jun 1, 2021
1 parent 3ace96e commit 8df9d8a
Show file tree
Hide file tree
Showing 16 changed files with 376 additions and 222 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fairyla",
"version": "0.1.0",
"version": "0.1.0-beta",
"license": "Apache-2.0",
"private": true,
"scripts": {
Expand Down
13 changes: 1 addition & 12 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,10 @@ export default {
try {
let data = JSON.parse(event.data)
this.handleEvent(data)
//es.close()
} catch (e) {
console.error(e)
}
})
es.addEventListener('error', (event) => {
if (event.readyState == EventSource.CLOSED) {
console.log('event was closed')
}
})
es.addEventListener('close', (event) => {
console.log(event.type)
es.close()
})
},
handleEvent(data) {
if (!Array.isArray(data) || data.length === 0) {
Expand Down Expand Up @@ -121,10 +111,9 @@ export default {
})
},
deleteEvent(id) {
console.log('delete', id)
this.$http.delete(`/user/event/${id}`).then(() => {
this.$message.success({
message: '事件已读,已经删除!',
message: '事件已标识为已读',
customClass: 'el-message--slim'
})
})
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Backtop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export default {
.back_to_top {
position: fixed;
z-index: 99999;
bottom: 2rem;
right: 1.5rem;
bottom: 2.5rem;
right: 1.8rem;
background-color: #fff;
color: #409eff;
border-radius: 50%;
Expand Down
23 changes: 9 additions & 14 deletions client/src/components/Fairy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@
<div class="post-info">
&nbsp;&nbsp; 所属:{{ album.owner }}
</div>
<div class="post-info" v-if="btns.length > 0">
<el-button
v-for="(btn, index) in btns"
<div class="post-info" v-if="Object.keys(btns).length > 0">
<fairy-btn
v-for="(btn, index) in Object.values(btns)"
:key="index"
size="mini"
:type="btn.type || 'primary'"
:plain="btn.plain"
:disabled="btn.disabled"
:icon="btn.icon"
@click="btn.click"
>{{ btn.name }}</el-button
>
:btn="btn"
></fairy-btn>
</div>
<div class="post-main" v-for="f in fairies" :key="f.id">
<video
Expand Down Expand Up @@ -79,6 +73,7 @@
import { defineProps } from 'vue'
import { isObject } from '@/libs/util.js'
import Backtop from './Backtop.vue'
import FairyBtn from './FairyBtn.vue'
defineProps({
album: {
Expand All @@ -101,10 +96,10 @@ defineProps({
},
urls: Array,
btns: {
type: Array,
type: Object,
validator: (value) => {
if (!Array.isArray(value)) return false
for (let v of value) {
if (!isObject(value)) return false
for (let v of Object.values(value)) {
if (!isObject(v)) return false
}
return true
Expand Down
51 changes: 51 additions & 0 deletions client/src/components/FairyBtn.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>
<el-badge
class="func-btn"
:is-dot="btn.badge.dot"
:value="btn.badge.value"
:type="btn.badge.type"
v-if="btn.badge"
>
<el-button
size="mini"
:type="btn.type"
:plain="btn.plain"
:disabled="btn.disabled"
:icon="btn.icon"
@click="btn.click"
>{{ btn.name }}</el-button
>
</el-badge>
<el-button
v-else
size="mini"
:type="btn.type"
:plain="btn.plain"
:disabled="btn.disabled"
:icon="btn.icon"
@click="btn.click"
>{{ btn.name }}</el-button
>
</template>

<script setup>
import { defineProps } from 'vue'
import { isObject } from '@/libs/util.js'
defineProps({
btn: {
type: Object,
validator: (value) => {
if (!isObject(value)) return false
if (!value.hasOwnProperty('name')) return false
return true
}
}
})
</script>

<style scoped>
.func-btn {
margin-right: 10px;
}
</style>
6 changes: 4 additions & 2 deletions client/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { http } from './libs/util.js'

import {
ElAvatar,
ElBadge,
ElButton,
ElButtonGroup,
ElCol,
Expand Down Expand Up @@ -57,6 +58,7 @@ import {

const components = [
ElAvatar,
ElBadge,
ElButton,
ElButtonGroup,
ElCol,
Expand Down Expand Up @@ -104,5 +106,5 @@ app.config.globalProperties.$http = http
app.config.globalProperties.$store = store
app.config.globalProperties.$ELEMENT = { size: 'mini' }
let vm = app.mount('#app')
window.app = app
window.vm = vm
//window.app = app
//window.vm = vm
Loading

0 comments on commit 8df9d8a

Please # to comment.