tiptap/examples/main.js

124 lines
3.4 KiB
JavaScript
Raw Normal View History

2018-08-22 15:14:49 +08:00
import '@babel/polyfill'
2018-08-21 05:02:21 +08:00
import Vue from 'vue'
2018-08-22 19:30:53 +08:00
import VueRouter from 'vue-router'
2018-08-21 05:02:21 +08:00
import svgSpriteLoader from 'helpers/svg-sprite-loader'
2018-08-22 20:10:44 +08:00
import App from 'Components/App'
2018-08-24 05:05:53 +08:00
import RouteBasic from 'Components/Routes/Basic'
2018-08-22 21:53:17 +08:00
import RouteMenuBubble from 'Components/Routes/MenuBubble'
2018-08-22 20:10:44 +08:00
import RouteLinks from 'Components/Routes/Links'
2018-09-01 02:42:13 +08:00
import RouteImages from 'Components/Routes/Images'
2018-08-22 22:05:44 +08:00
import RouteHidingMenuBar from 'Components/Routes/HidingMenuBar'
2018-08-22 22:20:56 +08:00
import RouteTodoList from 'Components/Routes/TodoList'
2018-08-22 22:34:04 +08:00
import RouteMarkdownShortcuts from 'Components/Routes/MarkdownShortcuts'
import RouteCodeHighlighting from 'Components/Routes/CodeHighlighting'
2018-08-23 01:28:57 +08:00
import RouteReadOnly from 'Components/Routes/ReadOnly'
2018-08-23 05:12:19 +08:00
import RouteEmbeds from 'Components/Routes/Embeds'
2018-09-02 02:51:17 +08:00
import RouteMentions from 'Components/Routes/Mentions'
2018-08-28 15:31:08 +08:00
import RouteExport from 'Components/Routes/Export'
2018-08-21 05:02:21 +08:00
const __svg__ = { path: './assets/images/icons/*.svg', name: 'assets/images/[hash].sprite.svg' }
svgSpriteLoader(__svg__.filename)
Vue.config.productionTip = false
2018-08-22 19:30:53 +08:00
Vue.use(VueRouter)
const routes = [
{
path: '/',
2018-08-24 05:05:53 +08:00
component: RouteBasic,
2018-08-23 00:23:31 +08:00
meta: {
2018-08-24 05:05:53 +08:00
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Basic',
2018-08-23 00:23:31 +08:00
},
2018-08-22 20:10:44 +08:00
},
{
2018-08-22 21:53:17 +08:00
path: '/menu-bubble',
component: RouteMenuBubble,
2018-08-23 00:23:31 +08:00
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/MenuBubble',
},
2018-08-22 20:10:44 +08:00
},
{
path: '/links',
component: RouteLinks,
2018-08-23 00:23:31 +08:00
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Links',
},
2018-08-22 19:30:53 +08:00
},
2018-09-01 02:42:13 +08:00
{
path: '/images',
component: RouteImages,
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Images',
},
},
2018-08-22 22:05:44 +08:00
{
path: '/hiding-menu-bar',
component: RouteHidingMenuBar,
2018-08-23 00:23:31 +08:00
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/HidingMenuBar',
},
2018-08-22 22:05:44 +08:00
},
2018-08-22 22:20:56 +08:00
{
path: '/todo-list',
component: RouteTodoList,
2018-08-23 00:23:31 +08:00
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/TodoList',
},
2018-08-22 22:20:56 +08:00
},
2018-08-22 22:34:04 +08:00
{
path: '/markdown-shortcuts',
component: RouteMarkdownShortcuts,
2018-08-23 00:23:31 +08:00
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/MarkdownShortcuts',
},
2018-08-22 22:34:04 +08:00
},
{
path: '/code-highlighting',
component: RouteCodeHighlighting,
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/CodeHighlighting',
},
},
2018-08-23 01:28:57 +08:00
{
path: '/read-only',
component: RouteReadOnly,
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/ReadOnly',
},
},
2018-08-23 05:12:19 +08:00
{
path: '/embeds',
component: RouteEmbeds,
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Embeds',
},
},
2018-09-02 02:51:17 +08:00
{
path: '/mentions',
component: RouteMentions,
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Mentions',
},
},
2018-08-28 15:31:08 +08:00
{
path: '/export',
component: RouteExport,
meta: {
githubUrl: 'https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Export',
},
},
2018-08-22 19:30:53 +08:00
]
const router = new VueRouter({
routes,
2018-09-03 20:00:18 +08:00
mode: 'history',
2018-08-22 20:10:44 +08:00
linkActiveClass: 'is-active',
linkExactActiveClass: 'is-exact-active',
2018-08-22 19:30:53 +08:00
})
2018-08-21 05:02:21 +08:00
new Vue({
2018-08-22 19:30:53 +08:00
router,
2018-08-21 05:02:21 +08:00
render: h => h(App),
}).$mount('#app')