add a hint component
This commit is contained in:
17
docs/src/components/Hint/index.vue
Normal file
17
docs/src/components/Hint/index.vue
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<template>
|
||||||
|
<div :class="`hint hint--${type}`">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" src="./style.scss" scoped></style>
|
||||||
10
docs/src/components/Hint/style.scss
Normal file
10
docs/src/components/Hint/style.scss
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.hint {
|
||||||
|
padding: 1rem;
|
||||||
|
border: 2px solid rgba($colorBlack, 0.1);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
|
||||||
|
&--warning {
|
||||||
|
border-color:#ffd8a8;
|
||||||
|
background-color: #fff4e6;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,7 +22,11 @@ Create a new Vue component (you can call it `<Tiptap />`) and add the following
|
|||||||
|
|
||||||
<demo name="GettingStarted" />
|
<demo name="GettingStarted" />
|
||||||
|
|
||||||
> If you are using Nuxt.js, note that tiptap needs to run in the client, not on the server. Wrapping the editor in a `<client-only>` tag is required.
|
<Hint type="warning">
|
||||||
|
|
||||||
|
If you are using **Nuxt.js**, note that tiptap needs to run in the client, not on the server. Wrapping the editor in a `<client-only>` tag is **required**.
|
||||||
|
|
||||||
|
</Hint>
|
||||||
|
|
||||||
Congrats! You’ve got it! 🎉 Let’s start to build your editor in the next step.
|
Congrats! You’ve got it! 🎉 Let’s start to build your editor in the next step.
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,14 @@ import 'prismjs/components/prism-jsx.js'
|
|||||||
import 'prismjs/components/prism-scss.js'
|
import 'prismjs/components/prism-scss.js'
|
||||||
import App from '~/layouts/App'
|
import App from '~/layouts/App'
|
||||||
import Demo from '~/components/Demo'
|
import Demo from '~/components/Demo'
|
||||||
|
import Hint from '~/components/Hint'
|
||||||
import Tab from '~/components/Tab'
|
import Tab from '~/components/Tab'
|
||||||
import ReactRenderer from '~/components/ReactRenderer'
|
import ReactRenderer from '~/components/ReactRenderer'
|
||||||
|
|
||||||
export default function (Vue, { router, head, isClient }) {
|
export default function (Vue, { router, head, isClient }) {
|
||||||
Vue.component('Layout', App)
|
Vue.component('Layout', App)
|
||||||
Vue.component('Demo', Demo)
|
Vue.component('Demo', Demo)
|
||||||
|
Vue.component('Hint', Hint)
|
||||||
Vue.component('Tab', Tab)
|
Vue.component('Tab', Tab)
|
||||||
Vue.component('ReactRenderer', ReactRenderer)
|
Vue.component('ReactRenderer', ReactRenderer)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user