本文介绍了Vuepress内部并与Vue项目集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Vuepress( https://vuepress.vuejs.org )开始,然后我d按照文档将其与现有项目集成( https://vuepress.vuejs.org/guide/getting-started.html#inside-an-existing-project ).我使用了摘要文件目录.

I´m starting with Vuepress (https://vuepress.vuejs.org), and i´d followed the docs to integrate it with an existing project (https://vuepress.vuejs.org/guide/getting-started.html#inside-an-existing-project). I used the sugested docs directory.

但是现在我需要真正"与我的项目集成,并且当我的用户访问my-project.com/docs时,我需要访问Vuepress文档

But now i need to "really" integrate with my project and i need to when my users access the my-project.com/docs, to reach the Vuepress docs

如果我制作(yarn docs:build),将生成/dist文件夹以用作静态HTML文件.我将/dist/内容放入我项目的/static/文件中.但是对/docs的vue-router响应是404.

If i make (yarn docs:build), the /dist folder will be generated to be used anywhere as a statics HTML files. I tought in put the /dist/ content in the /static/ files of my project. But the vue-router response to /docs is a 404.

我仍然需要进行2个构建,分别是我的项目和文档.

And i will still need to make 2 builds, my project and the docs.

问题是:

  1. 如何使Vue路由器查看" Vuepress构建文件?放在哪里?
  2. 我如何集成项目的运行版本以使它们同时实现?

我有2个项目,一个是类星体项目,另一个是我正在使用vue-cli 3.

I have 2 projects, one with quasar and the other i´m using vue-cli 3.

谢谢大家.

推荐答案

您不知道,它基本上是一个外部链接.一个简单的<a href="/docs">就足够了.

You don't, it's basically an external link. A simple <a href="/docs"> should be sufficient.

您没有,您添加了一个同时完成这两个任务的新任务.

You don't, you add a new task that does them both.

// package.json
{
  "scripts": {
    "build-project": "node build-project.js"
  }
}

从终端

# yarn run build-project  

这篇关于Vuepress内部并与Vue项目集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 04:55