Giter VIP home page Giter VIP logo

vmi's Issues

请教一下Vue2 + Vuepress 1的实现思路(2)

之前的方法在 md 文件中写死的情况下确实是可行的,但是在实时分析 标签并渲染组件的情况下不太可行。

逻辑大致是这样:在 html_inline 函数中解析 并渲染 demo 和 demo 源码,同时往 store 里存 demo 的组件名称和路径;然后在 render 中添加 <script setup> 注册 demo 组件。

但问题在于 render 函数是先于 html_inline 函数执行的,因此并不能正确的拿到 store 的组件名称和路径。

我想了很多方法始终解决不了这个问题,麻烦解答一下,万分感谢!!!

请教一下Vue2 + Vuepress 1的实现思路

vmi
我看了一下源码,大致整理了一下渲染 demo 的逻辑,想要在 Vuepress 1中实现一下,但是发现 Vuepress 1 中 extendPageData 传过来的 page 对象没有 sfcBlocks 属性,没法将 demo 注册为页面可以使用的组件;我想了各种办法去实现,最后都行不通;我第一次写 Vuepress 插件还不太熟悉,想请教一下 Vuepress 1的实现思路,万分感谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.