Skip to content

Commit

Permalink
docs: 全新的文档
Browse files Browse the repository at this point in the history
  • Loading branch information
xpyjs committed Jun 14, 2024
1 parent fbd9ab9 commit bb089f2
Show file tree
Hide file tree
Showing 50 changed files with 1,699 additions and 799 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist
dist-ssr
*.local
.vscode
*-old

yarn-*
*-lock.json
Expand Down
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
.temp
.cache
cache
dist

*-error.log
9 changes: 9 additions & 0 deletions docs/docs/.postcssrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { postcssIsolateStyles } from 'vitepress';

export default {
plugins: [
postcssIsolateStyles({
includeFiles: [/vp-doc\.css/] // 默认为 /base\.css/
})
]
};
99 changes: 99 additions & 0 deletions docs/docs/.vitepress/components/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<template>
<div
class="x-button"
:class="{ [`x-button--${type}`]: type, 'x-button--default': !type }"
>
<slot></slot>
</div>
</template>

<script setup>
defineProps({
type: String // 'primary' | 'danger' | 'warning' | 'success'
});
</script>

<style scoped lang="scss">
.x-button {
display: inline-block;
background-color: transparent;
padding: 6px 12px;
border-radius: 4px;
font-size: 14px;
font-weight: 500;
line-height: 20px;
cursor: pointer;
user-select: none;
transition: background-color 0.2s;
border: 1px solid #d9d9d9;
& + & {
margin-left: 8px;
}
&--default {
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
&:hover {
color: #eca710;
border-color: #eca710;
}
&:active {
background-color: #eca7103a;
}
}
&--primary {
background-color: #eca710;
color: #fff;
&:hover {
background-color: #f0b429;
}
&:active {
background-color: #d89e0e;
}
}
&--danger {
background-color: #f5222d;
color: #fff;
&:hover {
background-color: #f44c4c;
}
&:active {
background-color: #d93636;
}
}
&--warning {
background-color: #fd6e0f;
color: #fff;
&:hover {
background-color: #ff7b2f;
}
&:active {
background-color: #e65c0f;
}
}
&--success {
background-color: #52c41a;
color: #fff;
&:hover {
background-color: #73d13d;
}
&:active {
background-color: #3baa1e;
}
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<template>
<div class="param-root">
<span class="param-span">
<span v-if="r">
<!-- 下面两个 span 不要换行 -->
<span class="param-required">*required*</span><span>, </span>
</span>
<!-- 下面两个 span 不要换行 -->
<span v-if="t">type: {{ t }}</span
><span v-if="d">, </span>
<span v-if="d">default: {{ d }}</span>
<span v-if="f">{{ f }}</span>
</span>
</div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
name: "DataParameter",
props: {
// required
r: {
type: Boolean
},
// type
t: {
type: String
},
// default
d: {
type: String
},
// function
f: {
type: String
}
}
});
</script>

<style lang="scss" scoped>
.param-root {
margin-top: 5px;
.param-span {
font-weight: 500;
background-color: var(--c-details-bg);
padding: 0 5px 4px 5px;
border-radius: 2px;
.param-required {
color: red;
}
}
}
</style>
<template>
<div class="param-root">
<span class="param-span">
<span v-if="r">
<!-- 下面两个 span 不要换行 -->
<span class="param-required">*required*</span><span>, </span>
</span>
<!-- 下面两个 span 不要换行 -->
<span v-if="t">type: {{ t }}</span
><span v-if="d">, </span>
<span v-if="d">default: {{ d }}</span>
<span v-if="f">{{ f }}</span>
</span>
</div>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
name: "DataParameter",
props: {
// required
r: {
type: Boolean
},
// type
t: {
type: String
},
// default
d: {
type: String
},
// function
f: {
type: String
}
}
});
</script>

<style lang="scss" scoped>
.param-root {
margin-top: 5px;
.param-span {
font-weight: 500;
background-color: var(--c-details-bg);
padding: 0 5px 4px 5px;
border-radius: 2px;
.param-required {
color: red;
}
}
}
</style>
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
<template>
<div>
<p v-if="author" class="td-text">作者:{{ author }}</p>
<p v-if="date" class="td-text">日期:{{ date }}</p>
<p v-if="version" class="td-text">版本:{{ version }}</p>
<p v-if="copyright" class="td-text">版权:{{ copyright }}</p>

<hr class="td-hr" />
</div>
</template>

<script setup lang="ts">
import { defineProps } from "vue";
defineProps({
author: String,
date: String,
version: String,
copyright: String
});
</script>

<style lang="scss" scoped>
.td-text {
line-height: 1;
margin: 5px 0;
font-weight: bold;
}
.td-hr {
margin: 20px 0;
}
</style>
<template>
<div>
<p v-if="author" class="td-text">作者:{{ author }}</p>
<p v-if="date" class="td-text">日期:{{ date }}</p>
<p v-if="version" class="td-text">
版本:<img
style="vertical-align: text-bottom"
src="https://shields.io/github/v/release/xpyjs/gantt?display_name=tag&color=eca710&label="
/>
</p>
<p v-if="copyright" class="td-text">版权:{{ copyright }}</p>

<hr class="td-hr" />
</div>
</template>

<script setup lang="ts">
import { defineProps } from 'vue';
defineProps({
author: String,
date: String,
version: String,
copyright: String
});
</script>

<style lang="scss" scoped>
.td-text {
line-height: 1;
margin: 5px 0;
font-weight: bold;
}
.td-hr {
margin: 20px 0;
}
</style>
Loading

0 comments on commit bb089f2

Please sign in to comment.