52
src/views/guide/defineSteps.js
Normal file
52
src/views/guide/defineSteps.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const steps = [
|
||||
{
|
||||
element: '.hamburger-container',
|
||||
popover: {
|
||||
title: 'Hamburger',
|
||||
description: 'Open && Close sidebar',
|
||||
position: 'bottom'
|
||||
}
|
||||
},
|
||||
{
|
||||
element: '.breadcrumb-container',
|
||||
popover: {
|
||||
title: 'Breadcrumb',
|
||||
description: 'Indicate the current page location',
|
||||
position: 'bottom'
|
||||
}
|
||||
},
|
||||
{
|
||||
element: '.screenfull',
|
||||
popover: {
|
||||
title: 'Screenfull',
|
||||
description: 'Bring the page into fullscreen',
|
||||
position: 'left'
|
||||
}
|
||||
},
|
||||
{
|
||||
element: '.international-icon',
|
||||
popover: {
|
||||
title: 'Switch language',
|
||||
description: 'Switch the system language',
|
||||
position: 'left'
|
||||
}
|
||||
},
|
||||
{
|
||||
element: '.theme-switch',
|
||||
popover: {
|
||||
title: 'Theme Switch',
|
||||
description: 'Custom switch system theme',
|
||||
position: 'left'
|
||||
}
|
||||
},
|
||||
{
|
||||
element: '.tags-view-container',
|
||||
popover: {
|
||||
title: 'Tags view',
|
||||
description: 'The history of the page you visited',
|
||||
position: 'bottom'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default steps
|
34
src/views/guide/index.vue
Normal file
34
src/views/guide/index.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<p class="warn-content">
|
||||
{{$t('guide.description')}}
|
||||
<a href="https://github.com/kamranahmedse/driver.js" target="_blank">driver.js.
|
||||
</a>
|
||||
</p>
|
||||
<el-button icon='el-icon-question' type="primary" @click.prevent.stop="guide">{{$t('guide.button')}}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as Driver from 'driver.js' // import driver.js
|
||||
import 'driver.js/dist/driver.min.css' // import driver.js css
|
||||
import steps from './defineSteps'
|
||||
|
||||
export default {
|
||||
name: 'guide',
|
||||
data() {
|
||||
return {
|
||||
driver: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.driver = new Driver()
|
||||
},
|
||||
methods: {
|
||||
guide() {
|
||||
this.driver.defineSteps(steps)
|
||||
this.driver.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user