Giter VIP home page Giter VIP logo

Comments (11)

HcySunYang avatar HcySunYang commented on July 30, 2024 1

@ferrinweb
Very weird behavior, are you writing this comment outside of the root element of the template? You try to write it inside the root element, this problem will not occur, this may be a problem with vue-template-compiler .

from vuese.

HcySunYang avatar HcySunYang commented on July 30, 2024

You need to know which one of the .vue files to handle is wrong and provide the contents of the file to me. There is no better way now, I am very sorry, then I will think about a better way to reproduce.

from vuese.

ferrinweb avatar ferrinweb commented on July 30, 2024

I also encountered the same problem, and in addition, in many pages, props, slots, methods, events can not be identified, resulting in the corresponding part of the generated document is empty.

from vuese.

HcySunYang avatar HcySunYang commented on July 30, 2024

Can you give me a reproduced source file? Can be sent to my email, I will provide an online recurring solution as soon as possible

from vuese.

daledelv avatar daledelv commented on July 30, 2024

Add one,but mine is a private project,just follow the issue.

from vuese.

ferrinweb avatar ferrinweb commented on July 30, 2024

I console.log something in vuese/dist/vuese.js, line 116:

            comments.split('\n').forEach(c => {
                if ((matchs = c.match(leadRE))) {
                    currentKey = matchs[1];
                    res[currentKey] = res[currentKey] || [];
                    console.log(currentKey, ' | ', res[currentKey])
                    res[currentKey].push(c.replace(leadRE, '').trim());
                }
                else {
                    res.default.push(c);
                }
            });

and then:

D:\www\APP_BASE_TEMPLATE>vuese gen --include="src/components/*.vue"
? Select the target to generate Docute - The fastest way to create a documentation site for your project.
∞ Start creating markdown files...
param  |  []
param  |  [ 'x String X轴坐标' ]
param  |  [ 'x String X轴坐标', 'y String X轴坐标' ]
**constructor  |  function Object() { [native code] }**
TypeError: res[currentKey].push is not a function
    at comments.split.forEach.c (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:117:37)
    at Array.forEach (<anonymous>)
    at commentNodes.forEach (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:112:34)
    at Array.forEach (<anonymous>)
    at getComments (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:93:18)
    at ObjectProperty.properties.forEach (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:245:37)
    at Array.forEach (<anonymous>)
    at ObjectProperty (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:244:24)
    at NodePath._call (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\path\context.js:53:20)
    at NodePath.call (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\path\context.js:40:17)
    at NodePath.visit (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\path\context.js:88:12)
    at TraversalContext.visitQueue (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\context.js:118:16)
    at TraversalContext.visitMultiple (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\context.js:85:17)
    at TraversalContext.visit (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\context.js:144:19)
    at Function.traverse.node (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\index.js:94:17)
    at NodePath.visit (C:\Users\ferrinweb\AppData\Local\Yarn\Data\global\node_modules\@babel\traverse\lib\path\context.js:95:18)

so i think you can check the value obtained from 'res[currentKey]', pay attention to the words wrapped with '**' in the error stack above.

from vuese.

HcySunYang avatar HcySunYang commented on July 30, 2024

@ferrinweb
I guess your comment should look like:

/**
 * @param xxx
 * @constructor xxx
 */

But only @arg is really recognized.
Read the documentation carefully:
https://github.com/HcySunYang/vuese#write-a-document-for-your-component

from vuese.

ferrinweb avatar ferrinweb commented on July 30, 2024

Another error stack:

TypeError: Cannot read property 'children' of undefined
    at Object.comment (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vue-template-compiler\build.js:2575:21)
    at parseHTML (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vue-template-compiler\build.js:345:23)
    at parse (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vue-template-compiler\build.js:2402:3)
    at baseCompile (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vue-template-compiler\build.js:4267:13)
    at Object.compile (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vue-template-compiler\build.js:4242:22)
    at sfcToAST (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:28:47)
    at parser$1 (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vuese\dist\vuese.js:402:20)
    at files.map (C:\Users\zuoyi\AppData\Local\Yarn\Data\global\node_modules\vuese\lib\index.js:30:23)
    at <anonymous>

Does a multi-line comment (such as the one below) cause the error?

<!-- Author: ferrinweb -->
<!-- Create Time: 2018/9/30 14:34 -->
<!-- Description: image-editor -->
<!-- How to use?
import as component, and then:
<image-editor class="image-editor hw100"
    v-if="showEditor"
    :source="editSource"
    @image-edit-done="showNewImage"
></image-editor>
-->

from vuese.

ferrinweb avatar ferrinweb commented on July 30, 2024

I have test, and you are right. thanks!

Thank you for this amazing work, again!

from vuese.

NBSeven avatar NBSeven commented on July 30, 2024

same problem... your Basic component

from vuese.

HcySunYang avatar HcySunYang commented on July 30, 2024

Close inactive

from vuese.

Related Issues (20)

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.