🎨 improve format

This commit is contained in:
yanyongyu
2021-04-05 16:35:29 +08:00
parent 176dbd5830
commit 207750774d
9 changed files with 131 additions and 115 deletions

View File

@ -82,8 +82,8 @@
color="blue darken-1"
text
@click="
dialog = false
publishPlugin()
dialog = false;
publishPlugin();
"
>
发布
@ -93,14 +93,16 @@
</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-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-row>
<v-row>
<v-col
cols="12"
@ -131,18 +133,18 @@
</template>
<script>
import PublishCard from './PublishCard.vue'
import plugins from '../public/plugins.json'
import PublishCard from "./PublishCard.vue";
import plugins from "../public/plugins.json";
export default {
name: 'Plugins',
name: "Plugins",
components: {
PublishCard,
},
data() {
return {
plugins: plugins,
filterText: '',
filterText: "",
page: 1,
dialog: false,
valid: false,
@ -153,32 +155,32 @@ export default {
link: null,
repo: null,
},
}
};
},
computed: {
pageNum() {
return Math.ceil(this.filteredPlugins.length / 10)
return Math.ceil(this.filteredPlugins.length / 10);
},
filteredPlugins() {
return this.plugins.filter((plugin) => {
return (
plugin.id.indexOf(this.filterText || '') != -1 ||
plugin.name.indexOf(this.filterText || '') != -1 ||
plugin.desc.indexOf(this.filterText || '') != -1 ||
plugin.author.indexOf(this.filterText || '') != -1
)
})
plugin.id.indexOf(this.filterText || "") != -1 ||
plugin.name.indexOf(this.filterText || "") != -1 ||
plugin.desc.indexOf(this.filterText || "") != -1 ||
plugin.author.indexOf(this.filterText || "") != -1
);
});
},
displayPlugins() {
return this.filteredPlugins.slice((this.page - 1) * 10, this.page * 10)
return this.filteredPlugins.slice((this.page - 1) * 10, this.page * 10);
},
publishPlugin() {
if (!this.$refs.newPluginForm.validate()) {
return
return;
}
const title = encodeURIComponent(
`Plugin: ${this.newPlugin.name}`
).replace(/%2B/gi, '+')
).replace(/%2B/gi, "+");
const body = encodeURIComponent(
`
**插件名称:**
@ -210,11 +212,11 @@ ${this.newPlugin.repo}
- repo: ${this.newPlugin.repo}
-->
`.trim()
).replace(/%2B/gi, '+')
).replace(/%2B/gi, "+");
window.open(
`https://github.com/nonebot/nonebot2/issues/new?title=${title}&body=${body}&labels=Plugin`
)
);
},
},
}
};
</script>