add a hint component

This commit is contained in:
Hans Pagel 2020-08-13 11:37:46 +02:00
parent a283f051f0
commit f9d272779e
4 changed files with 34 additions and 1 deletions

View 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>

View 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;
}
}

View File

@ -22,7 +22,11 @@ Create a new Vue component (you can call it `<Tiptap />`) and add the following
<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! Youve got it! 🎉 Lets start to build your editor in the next step.

View File

@ -3,12 +3,14 @@ import 'prismjs/components/prism-jsx.js'
import 'prismjs/components/prism-scss.js'
import App from '~/layouts/App'
import Demo from '~/components/Demo'
import Hint from '~/components/Hint'
import Tab from '~/components/Tab'
import ReactRenderer from '~/components/ReactRenderer'
export default function (Vue, { router, head, isClient }) {
Vue.component('Layout', App)
Vue.component('Demo', Demo)
Vue.component('Hint', Hint)
Vue.component('Tab', Tab)
Vue.component('ReactRenderer', ReactRenderer)
}