Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Commit 142da41

Browse files
committed
fix(docs): fix inline vue components
1 parent 32dc094 commit 142da41

File tree

8 files changed

+112
-78
lines changed

8 files changed

+112
-78
lines changed

docs/src/.vitepress/components/Base/BaseBtn.vue renamed to docs/src/.vitepress/components/Components/BaseBtn.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
}
1414
</script>
1515

16-
<style lang="scss" scoped>
16+
<style lang="scss">
1717
.base-btn {
1818
cursor: pointer;
1919
display: inline-block;

docs/src/.vitepress/components/Layout/BtnWrapper.vue renamed to docs/src/.vitepress/components/Components/BtnWrapper.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
}
1111
</script>
1212

13-
<style lang="scss" scoped>
13+
<style lang="scss">
1414
.btn-wrapper {
1515
padding: 30px;
1616
border-radius: 4px;

docs/src/.vitepress/components/Dialogs/Guide/BaseDialog.vue

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/src/.vitepress/components/Dialogs/Guide/BaseStyledDialog.vue

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<GDialog v-model="value">
3+
Content
4+
</GDialog>
5+
6+
<BtnWrapper>
7+
<BaseBtn @click="onOpen">
8+
Open Dialog
9+
</BaseBtn>
10+
</BtnWrapper>
11+
</template>
12+
13+
<script>
14+
import {ref, computed} from 'vue'
15+
16+
export default {
17+
name: 'base-dialog',
18+
19+
setup() {
20+
const dialogState = ref(false)
21+
22+
const value = computed({
23+
get() {
24+
return dialogState.value
25+
},
26+
set(val) {
27+
dialogState.value = val
28+
}
29+
})
30+
31+
const onOpen = ()=>{
32+
value.value = true
33+
}
34+
35+
return {
36+
value,
37+
onOpen
38+
}
39+
},
40+
}
41+
</script>
42+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<GDialog v-model="value" max-width="500">
3+
<div class="getting-started-example-styled">
4+
Content
5+
</div>
6+
</GDialog>
7+
8+
<BtnWrapper>
9+
<BaseBtn @click="onOpen">
10+
Open Dialog
11+
</BaseBtn>
12+
</BtnWrapper>
13+
</template>
14+
15+
<script>
16+
import {ref, computed} from 'vue'
17+
18+
export default {
19+
name: 'base-dialog',
20+
21+
setup() {
22+
const dialogState = ref(false)
23+
24+
const value = computed({
25+
get() {
26+
return dialogState.value
27+
},
28+
set(val) {
29+
dialogState.value = val
30+
}
31+
})
32+
33+
const onOpen = ()=>{
34+
value.value = true
35+
}
36+
37+
return {
38+
value,
39+
onOpen
40+
}
41+
},
42+
}
43+
</script>
44+
45+
<style lang="scss">
46+
.getting-started-example-styled {
47+
padding: 30px;
48+
background: #fff;
49+
}
50+
</style>
51+

docs/src/.vitepress/theme/index.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import DefaultTheme from 'vitepress/theme'
2-
// import { GDialog } from 'gitart-vue-dialog'
3-
// import 'gitart-vue-dialog/dist/style.css'
2+
import { GDialog } from 'gitart-vue-dialog'
3+
import 'gitart-vue-dialog/dist/style.css'
44
import './custom.css'
55

6-
// import BaseBtn from '@/.vitepress/components/Base/BaseBtn.vue'
7-
8-
// import BtnWrapper from '@/.vitepress/components/Layout/BtnWrapper.vue'
6+
import BaseBtn from '@/.vitepress/components/Components/BaseBtn.vue'
7+
import BtnWrapper from '@/.vitepress/components/Components/BtnWrapper.vue'
98

109
export default {
1110
...DefaultTheme,
1211
enhanceApp({ app }) {
13-
// app.component('GDialog', GDialog)
14-
15-
// app.component('BaseBtn', BaseBtn)
16-
// app.component('BtnWrapper', BtnWrapper)
12+
app.component('GDialog', GDialog)
13+
app.component('BaseBtn', BaseBtn)
14+
app.component('BtnWrapper', BtnWrapper)
1715
}
1816
}

docs/src/docs/introduction/getting-started.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<!-- <script setup>
2-
import BaseDialog from '@/.vitepress/components/Dialogs/Guide/BaseDialog.vue'
3-
import BaseStyledDialog from '@/.vitepress/components/Dialogs/Guide/BaseStyledDialog.vue'
4-
</script> -->
1+
52

63
![Tux, the Linux mascot](/gitart-dialog-logo.svg)
74

@@ -34,8 +31,15 @@ Let's use standalone component (without installing plugin)
3431
<<< @/.vitepress/includes/minumal-working-example/YourComponent.js
3532
<<< @/.vitepress/includes/minumal-working-example/YourComponent.html
3633

37-
<!-- <BaseDialog />
34+
<script setup>
35+
import GettingStartedExample from '@/.vitepress/components/GettingStartedExample.vue'
36+
import GettingStartedExampleStyled from '@/.vitepress/components/GettingStartedExampleStyled.vue'
37+
</script>
38+
39+
<GettingStartedExample />
3840

3941
Pretty **ugly** dialog, right? Let's add max-width, background and some padding. Take a look:
4042

41-
<BaseStyledDialog /> -->
43+
<GettingStartedExampleStyled />
44+
45+
Looks better. Here is more advanced [examples](https://michaelgitart.github.io/gitart-vue-dialog)

0 commit comments

Comments
 (0)