Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows下面运行gen直接NPM报错退出 #22

Closed
a526672351 opened this issue Jan 9, 2019 · 11 comments
Closed

Windows下面运行gen直接NPM报错退出 #22

a526672351 opened this issue Jan 9, 2019 · 11 comments

Comments

@a526672351
Copy link

image

0 info it worked if it ends with ok
1 verbose cli [ 'd:\Program Files\nodejs\node.exe',
1 verbose cli 'd:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'gen' ]
2 info using npm@5.6.0
3 info using node@v8.11.3
4 verbose run-script [ 'pregen', 'gen', 'postgen' ]

13 verbose stack Error: egg-vue-boilerplate@1.0.0 gen: vuese gen --include="app/web/**/*.vue"
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Users\H004335.WTOIP\AppData\Roaming\nvm\v8.11.3\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (C:\Users\H004335.WTOIP\AppData\Roaming\nvm\v8.11.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

@HcySunYang
Copy link
Member

Reinstall v1.4.5

@a526672351
Copy link
Author

@HcySunYang 文件遍历生成文档不全,只能便利获取第一个文件夹.vue文件
image
image

@HcySunYang
Copy link
Member

Please show your vuese.config.js or .vueserc configuration

@a526672351
Copy link
Author

@HcySunYang .vueserc 如下
{ "include": ["**/*.vue"], "exclude": ["node_modules/**/*.vue"], "title": "egg-vue" }

@HcySunYang
Copy link
Member

检查你上面的两张截图,你会发现 layout/index/content/content.vue 组件已经生成了 VContent.md。之所以 footer.vueheader.vue 没有生成对应的 md 文档,是因为这两个组件中没有插槽、事件、prop 以及需要暴露的方法,这时候 vuese 不会为它生成文档,是为了避免生成空的 md 文件。请查看这个 issue: #18

@a526672351
Copy link
Author

a526672351 commented Jan 9, 2019

@HcySunYang
https://github.com/a526672351/egg-vue-boilerplate
可以查看这个工程结构,加入配置只能生成第一个目录的bug,工程page和里面component目录header.vue里面带有方法的,也有data,都无法生成

@HcySunYang
Copy link
Member

首先生成文档时只关注一个组件的四个部分:slot、event、props 以及带有 @vuese 注解的 method,所以并不会理会 data。以你的 header.vue 为例,如果你想要 menuBtn 方法包含在生成的文档中,你需要添加 @vuese 注解,如下:

export default {
  components: {},
  data() {
    return {
      collapsed: false
    };
  },
  computed: {},
  methods: {
    // @vuese
    menuBtn() {
      this.collapsed = !this.collapsed;
    }
  },
  mounted() {}
};

为什么这么设计,文档中有说,请仔细阅读文档:https://github.com/vuese/vuese#write-a-document-for-your-component

@a526672351
Copy link
Author

@HcySunYang 好的,明白了,还有几个体验不太好的问题如下:
1.组件命名有可能重名区分困难
2.如果props 的类型是Function或Object显示内容换行条例不清晰如下。
image

@a526672351
Copy link
Author

3.出现了文档显示错乱的问题。
image
可以下载该仓库组件本地生成复原错乱问题,地址如下:
https://github.com/weifeiyue/vue-datepicker-local/tree/master/src

@HcySunYang
Copy link
Member

这个问题需要优化,一个临时解决方案是:先在default选项上添加一个注释,用来代替原始默认值即可

@a526672351
Copy link
Author

等待优化版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants