Skip to content

Commit 24454f1

Browse files
committed
docs(docs): add install docs
1 parent 3688850 commit 24454f1

File tree

1 file changed

+92
-20
lines changed

1 file changed

+92
-20
lines changed

src/views/pages/docs/install.vue

Lines changed: 92 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,129 @@
22
<DocHeader>
33
<template #title> Installation </template>
44
<template #subtitle> Get started in seconds </template>
5-
<template #notice>
6-
This project is in early development. There still may be significant
7-
changes in the future, so please use with caution. Follow us on
8-
<Anchor
9-
variant="primary"
10-
classAppend="space-x-1"
11-
classRemove="space-x-2"
12-
href="https://twitter.com/usezephyr"
13-
newTab
14-
>Twitter</Anchor
15-
>
16-
for updates.
5+
<template #right-side>
6+
<div :class="tw`justify-end flex items-start md:mt-2 space-x-2`">
7+
<Badge classAppend="bg-yellow-500 text-gray-900">In Progress</Badge>
8+
</div>
179
</template>
1810
</DocHeader>
19-
<div :class="tw`my-12 space-y-12`">
11+
<div :class="tw`mt-12 mb-24 space-y-12`">
12+
<section>
13+
<h3 :class="tw`font-medium text(gray-900 dark:gray-100 3xl)`">
14+
Requirements
15+
</h3>
16+
<div :class="tw`border(t gray-200 dark:gray-800) my-4`"></div>
17+
<div :class="tw`space-y-6 mt-6`">
18+
<p>
19+
Vue Zephyr currently supports Vue 3 and higher (as released). There
20+
are no plans to support Vue 2.
21+
</p>
22+
</div>
23+
</section>
2024
<section>
2125
<h3 :class="tw`font-medium text(gray-900 dark:gray-100 3xl)`">Install</h3>
2226
<div :class="tw`border(t gray-200 dark:gray-800) my-4`"></div>
23-
<div :class="tw`space-y-6`">
27+
<div :class="tw`space-y-6 mt-6`">
2428
<p>
2529
Inside your project directory root install Vue Zephyr via NPM or Yarn:
2630
</p>
31+
<div :class="tw`space-y-4`">
32+
<div :class="tw`rounded-lg overflow-hidden`">
33+
<Code lang="bash" :code="codes.npmInstall" inline />
34+
</div>
35+
<div :class="tw`rounded-lg overflow-hidden`">
36+
<Code lang="bash" :code="codes.yarnInstall" inline />
37+
</div>
38+
</div>
39+
</div>
40+
</section>
41+
<section>
42+
<h3 :class="tw`font-medium text(gray-900 dark:gray-100 3xl)`">
43+
Configure
44+
</h3>
45+
<div :class="tw`border(t gray-200 dark:gray-800) my-4`"></div>
46+
<div :class="tw`space-y-6 mt-8`">
47+
<p>There are two methods of adding Vue Zephyr to your application.</p>
48+
<p>Use as plugin:</p>
49+
<div :class="tw`rounded-lg overflow-hidden`">
50+
<Code lang="js" :code="codes.configAsPlugin" />
51+
</div>
52+
<p>Or import components individually:</p>
53+
<div :class="tw`rounded-lg overflow-hidden`">
54+
<Code lang="vue" :code="codes.configAsComponent" />
55+
</div>
56+
<h4 :class="tw`font-medium text(gray-900 dark:gray-100 xl)`">
57+
Plugin Options
58+
</h4>
2759
<div :class="tw`rounded-lg overflow-hidden`">
28-
<Code lang="bash" :code="codes.npmInstall" />
29-
<Code lang="bash" :code="codes.yarnInstall" />
60+
<Code lang="js" :code="codes.pluginConfig" />
3061
</div>
3162
</div>
3263
</section>
3364
</div>
3465
</template>
3566

3667
<script lang="ts">
68+
/* eslint-disable no-useless-escape */
3769
import { defineComponent } from "vue";
3870
import DocHeader from "@/views/components/DocHeader.vue";
71+
import Badge from "@/views/components/Badge.vue";
3972
import Code from "@/views/components/Code.vue";
4073
import { tw } from "twind";
4174
4275
export default defineComponent({
4376
components: {
4477
DocHeader,
4578
Code,
79+
Badge,
4680
},
4781
setup() {
4882
const codes = {
4983
npmInstall: `npm i @usezephyr/vue-zephyr`,
5084
yarnInstall: `yarn add @usezephyr/vue-zephyr`,
85+
configAsPlugin: `
86+
import { createApp } from "vue";
87+
import App from "./App.vue";
88+
import Zephyr from "@usezephyr/vue-zephyr";
89+
90+
const app = createApp(App);
91+
92+
// \`Zephyr\` is a function that needs to be called here
93+
app.use(Zephyr(/* Config Options here */));
94+
app.mount("#app");
95+
`,
96+
configAsComponent: `
97+
// Replace \`ExampleComponent\` with whichever component you would like to import
98+
<template>
99+
<ExampleComponent />
100+
</template>
101+
102+
<script>
103+
import { ExampleComponent } from "@usezephyr/vue-zephyr";
104+
export default {
105+
components: { ExampleComponent }
106+
};
107+
<\/script>
108+
`,
109+
pluginConfig: `
110+
import { createApp } from "vue";
111+
import App from "./App.vue";
112+
import Zephyr from "@usezephyr/vue-zephyr";
113+
import myTheme from "./myTheme.js"
114+
115+
const app = createApp(App);
116+
const ZConfig = {
117+
theme: myTheme,
118+
twind: {
119+
enabled: true, /* Defaults to true */
120+
setup: { /* Twind configuration */ }
121+
}
122+
}
123+
app.use(Zephyr(ZConfig));
124+
app.mount("#app");
125+
`,
51126
};
52127
return { codes, tw };
53128
},
54129
});
55-
</script>
56-
57-
<style scoped>
58-
</style>
130+
</script>

0 commit comments

Comments
 (0)