🎨 format files

This commit is contained in:
StarHeartHunt
2021-04-05 13:44:19 +08:00
parent 20e1bf9624
commit 1c6711355e
10 changed files with 174 additions and 174 deletions

View File

@ -68,8 +68,8 @@
color="blue darken-1"
text
@click="
dialog = false;
publishBot();
dialog = false
publishBot()
"
>
发布
@ -79,14 +79,14 @@
</v-dialog>
</v-col>
</v-row>
<v-col cols="12">
<v-pagination
v-model="page"
:length="pageNum"
prev-icon="fa-caret-left"
next-icon="fa-caret-right"
></v-pagination>
</v-col>
<v-col cols="12">
<v-pagination
v-model="page"
:length="pageNum"
prev-icon="fa-caret-left"
next-icon="fa-caret-right"
></v-pagination>
</v-col>
<v-row>
<v-col cols="12" sm="6" v-for="(bot, index) in displayBots" :key="index">
<PublishCard
@ -97,64 +97,64 @@
></PublishCard>
</v-col>
</v-row>
<v-col cols="12">
<v-pagination
v-model="page"
:length="pageNum"
prev-icon="fa-caret-left"
next-icon="fa-caret-right"
></v-pagination>
</v-col>
<v-col cols="12">
<v-pagination
v-model="page"
:length="pageNum"
prev-icon="fa-caret-left"
next-icon="fa-caret-right"
></v-pagination>
</v-col>
</v-card>
</template>
<script>
import PublishCard from "./PublishCard.vue";
import bots from "../public/bots.json";
import PublishCard from './PublishCard.vue'
import bots from '../public/bots.json'
export default {
name: "Bots",
name: 'Bots',
components: {
PublishCard
PublishCard,
},
data() {
return {
bots: bots,
filterText: "",
filterText: '',
page: 1,
dialog: false,
valid: false,
newBot: {
name: null,
desc: null,
repo: null
}
};
repo: null,
},
}
},
computed: {
pageNum() {
return Math.ceil(this.filteredBots.length / 10);
return Math.ceil(this.filteredBots.length / 10)
},
filteredBots() {
return this.bots.filter(bot => {
return this.bots.filter((bot) => {
return (
bot.name.indexOf(this.filterText || "") != -1 ||
bot.desc.indexOf(this.filterText || "") != -1 ||
bot.author.indexOf(this.filterText || "") != -1
);
});
bot.name.indexOf(this.filterText || '') != -1 ||
bot.desc.indexOf(this.filterText || '') != -1 ||
bot.author.indexOf(this.filterText || '') != -1
)
})
},
displayBots() {
return this.filteredBots.slice((this.page - 1) * 10, this.page * 10);
return this.filteredBots.slice((this.page - 1) * 10, this.page * 10)
},
publishBot() {
if (!this.$refs.newBotForm.validate()) {
return;
return
}
const title = encodeURIComponent(`Bot: ${this.newBot.name}`).replace(
/%2B/gi,
"+"
);
'+'
)
const body = encodeURIComponent(
`
**机器人名称:**
@ -176,11 +176,11 @@ ${this.newBot.repo}
- repo: ${this.newBot.repo}
-->
`.trim()
).replace(/%2B/gi, "+");
).replace(/%2B/gi, '+')
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Bot`
);
}
}
};
)
},
},
}
</script>