Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Oct 2, 2021
1 parent 837dd74 commit deeeb32
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 24 deletions.
39 changes: 19 additions & 20 deletions playground/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
<template>
<div style="position: relative">
<img
:src="githubLogoUrl"
style="position: fixed; right: 0; top: 0; height: 60px"
@click="open('https://github.com/axetroy/whatchanged')"
/>
<a src="https://github.com/axetroy/whatchanged">
<img :src="githubLogoUrl" style="position: fixed; right: 0; top: 0; height: 60px" />
</a>

<div class="toolbar">
<!-- <img :src="require('@/assets/logo.png')" /> -->
<a-form
layout="inline"
:model="form"
@submit="onSubmit"
@submit.native.prevent
>
<img style="max-width: 100%; max-height: 100%" src="./assets/logo.png" />
<a-form layout="inline" :model="form" @submit.native.prevent="onSubmit">
<a-form-item label="Username">
<a-input v-model:value="form.username.value" />
</a-form-item>
<a-form-item label="Repo">
<a-input v-model:value="form.repo.value" />
</a-form-item>
<a-form-item label="Branch">
<a-input v-model:value="form.branch.value" />
</a-form-item>
<a-form-item label="Version">
<a-input v-model:value="form.version.value" />
</a-form-item>
<a-form-item>
<a-button type="primary" html-type="submit" :loading="loading">
Generate
</a-button>
<a-button type="primary" html-type="submit" :loading="loading"> Generate </a-button>
<a-button type="default" @click="copyURL" style="margin-left: 20px">
<!-- <MessageOutlined :style="{ fontSize: '16px', color: '#08c' }" /> -->
Share
Expand Down Expand Up @@ -68,6 +63,7 @@ let template = ref(TEMPLATE_DEFAULT);
const formReactive = reactive({
username: "axetroy",
repo: "whatchanged",
branch: "master",
version: "HEAD~",
});
Expand Down Expand Up @@ -112,11 +108,9 @@ function onSubmit() {
});
fetch(
`${import.meta.env.VITE_API_HOST}/?username=${
formReactive.username || ""
}&repo=${formReactive.repo || ""}&version=${
formReactive.version || ""
}&template=${tpl || ""}`
`${import.meta.env.VITE_API_HOST}/?username=${formReactive.username || ""}&repo=${formReactive.repo || ""}&branch=${
formReactive.branch
}&version=${formReactive.version || ""}&template=${tpl || ""}`
)
.then((res) => res.text())
.then((markdown) => {
Expand Down Expand Up @@ -167,6 +161,11 @@ onMounted(() => {
params++;
}
if (url.searchParams.has("branch")) {
formReactive.repo = url.searchParams.get("branch");
params++;
}
if (url.searchParams.has("version")) {
formReactive.version = url.searchParams.get("version");
}
Expand Down
2 changes: 1 addition & 1 deletion playground/src/assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion playground/src/components/CodeMirror.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script setup>
import { onMounted, ref, toRefs, watch, defineEmit, defineProps } from "vue";
import { onMounted, ref, toRefs } from "vue";
import CodeMirror from "https://cdn.jsdelivr.net/npm/codemirror/src/codemirror.js";
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion playground/src/components/Markdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>

<script setup>
import { computed, defineProps, toRefs } from "vue";
import { computed, toRefs } from "vue";
import marked from "marked";
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion playground/src/components/Render.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</template>

<script setup>
import { defineProps, toRefs } from "vue";
import { toRefs } from "vue";
import Markdown from "./Markdown.vue";
import CodeMirror from "./CodeMirror.vue";
Expand Down

0 comments on commit deeeb32

Please sign in to comment.