Skip to content

Commit

Permalink
docs: 📝 moving examples to be imported
Browse files Browse the repository at this point in the history
  • Loading branch information
davidroyer committed Jun 12, 2019
1 parent a02efbf commit 6a49a96
Show file tree
Hide file tree
Showing 16 changed files with 268 additions and 193 deletions.
15 changes: 15 additions & 0 deletions docs/.vuepress/code-examples/source/basic.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<vue-editor v-model="content" />
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
})
};
</script>
15 changes: 15 additions & 0 deletions docs/.vuepress/code-examples/source/custom-image-handler.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<vue-editor v-model="content" />
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
})
};
</script>
15 changes: 15 additions & 0 deletions docs/.vuepress/code-examples/source/custom-modules.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<vue-editor v-model="content" />
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
})
};
</script>
20 changes: 20 additions & 0 deletions docs/.vuepress/code-examples/source/custom-toolbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<vue-editor v-model="content" :editor-toolbar="customToolbar" />
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Html For Editor</h1>",
customToolbar: [
["bold", "italic", "underline"],
[{ list: "ordered" }, { list: "bullet" }],
["image", "code-block"]
]
})
};
</script>
15 changes: 15 additions & 0 deletions docs/.vuepress/code-examples/source/event-listening.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<vue-editor v-model="content" />
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
})
};
</script>
18 changes: 18 additions & 0 deletions docs/.vuepress/code-examples/source/live-preview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<div>
<vue-editor v-model="content" />
<div>{{ content }}</div>
</div>
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
})
};
</script>
15 changes: 15 additions & 0 deletions docs/.vuepress/code-examples/source/multiple-editors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<vue-editor v-model="content" />
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
})
};
</script>
55 changes: 55 additions & 0 deletions docs/.vuepress/code-examples/source/save-content.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div>
<button @click="saveContent">Save</button>
<vue-editor v-model="content" />
</div>
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
}),
methods: {
handleSavingContent() {
// You have the content to save
console.log(this.content);
}
}
};
</script>

<template>
<div id="app">
<button @click="saveContent"></button>
<vue-editor v-model="content"></vue-editor>
</div>
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: {
VueEditor
},
data() {
return {
content: "<h3>Initial Content</h3>"
};
},
methods: {
handleSavingContent() {
// You have the content to save
console.log(this.content);
}
}
};
</script>
24 changes: 24 additions & 0 deletions docs/.vuepress/code-examples/source/set-contents.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div>
<button @click="setEditorContent">Set Editor Content</button>
<vue-editor v-model="content" />
</div>
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: null
}),
methods: {
setEditorContent() {
this.content = "<h1>Html For Editor</h1>";
}
}
};
</script>
24 changes: 24 additions & 0 deletions docs/.vuepress/code-examples/source/set-focus.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div>
<button @click.prevent="focusEditor">Focus Editor</button>
<vue-editor ref="editor" v-model="content" />
</div>
</template>

<script>
import { VueEditor } from "vue2-editor";
export default {
components: { VueEditor },
data: () => ({
content: "<h1>Some initial content</h1>"
}),
methods: {
focusEditor() {
this.$refs.editor.quill.focus();
}
}
};
</script>
37 changes: 10 additions & 27 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const path = require("path");
// const path = require("path");
const { version } = require("../../package.json");

module.exports = {
head: [
[
"script",
{
src: "https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"
}
],
// [
// "script",
// {
// src: "https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"
// }
// ],
[
"script",
{
Expand All @@ -30,9 +30,8 @@ module.exports = {
],
plugins: [
require("./plugin.js"),
"live",
"demo-block",

// "live",
// "demo-block",
[
"@vuepress/google-analytics",
{
Expand Down Expand Up @@ -62,24 +61,8 @@ module.exports = {
link: "https://github.com/davidroyer/vue2-editor/releases"
}
],
// sidebar: ["/installation.md", "/started.md", "/usage.md"]
sidebar: ["/guide/", "/examples/"]
// sidebar: 'auto'
}
}
},

/**
* Allows the use of using aliases in files for easier importing
*/
configureWebpack: {
resolve: {
alias: {
"@root": path.resolve(__dirname, "../../"),
"@src": path.resolve(__dirname, "../../src"),
"@mixins": path.resolve(__dirname, "../../src/mixins"),
"@utils": path.resolve(__dirname, "../../utils"),
"@images": "./../images"
// sidebar: ["/guide/", "/examples/", "/playground.md"]
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions docs/.vuepress/snippets/demo.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/.vuepress/styles/palette.styl
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ img {
}

.vuepress-plugin-demo-block__wrapper .vuepress-plugin-demo-block__code
overflow: scroll
overflow: scroll
Loading

0 comments on commit 6a49a96

Please sign in to comment.