open files in vscode in development
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
export default function (Vue, options, context) {
|
export default function (Vue, options, context) {
|
||||||
|
|
||||||
|
Vue.mixin({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
cwd: options.cwd,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
context.router.afterEach(to => {
|
context.router.afterEach(to => {
|
||||||
if (to.hash) {
|
if (to.hash) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ const globby = require('globby')
|
|||||||
|
|
||||||
module.exports = function (api) {
|
module.exports = function (api) {
|
||||||
|
|
||||||
|
api.setClientOptions({
|
||||||
|
cwd: process.cwd(),
|
||||||
|
})
|
||||||
|
|
||||||
api.loadSource(({ addCollection }) => {
|
api.loadSource(({ addCollection }) => {
|
||||||
const appCollection = addCollection({ typeName: 'Package' })
|
const appCollection = addCollection({ typeName: 'Package' })
|
||||||
|
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ export default {
|
|||||||
const { currentPath } = this
|
const { currentPath } = this
|
||||||
const filePath = currentPath === '' ? '/introduction' : currentPath
|
const filePath = currentPath === '' ? '/introduction' : currentPath
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
return `vscode://file${this.cwd}/src/docPages${filePath}.md`
|
||||||
|
}
|
||||||
|
|
||||||
return `https://github.com/ueberdosis/tiptap-next/blob/main/docs/src/docPages${filePath}.md`
|
return `https://github.com/ueberdosis/tiptap-next/blob/main/docs/src/docPages${filePath}.md`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user