vue.js提示 Unknown custom element: <v-grid>

采用vue.js+vue-router+webpack,自定义了一个grid组件v-grid,在vue-router中页面中使用v-vgrid组件提示: Unknown custom element: <v-grid> - did you register the component correctly?,在入口页面app.vue使用没有问题!请问这是咋回事?谢谢!

阅读 68.3k
4 个回答

已经解决,vue文件中<template>html代码错误导致的!

新手上路,请多包涵

组件名字是 MyButton时,name为 mybutton 调用的时候不生效,编译没问题,浏览器会报和楼主一样的错。
把文件名字改成 Mybutton 再调用就没问题了。

在 components里面注册了吗

新手上路,请多包涵

vue-validator版本不同导致的

<validator name="validation">
  <form novalidate>
    <input type="text" v-validate:comment="{ minlength: 16, maxlength: 128 }">
    <div>
      <span v-show="$validation.comment.minlength">Your comment is too short.</span>
      <span v-show="$validation.comment.maxlength">Your comment is too long.</span>
    </div>
    <input type="submit" value="send" v-if="valid">
  </form>
</validator>

v3.0-alpha or later:

<div id="app">
  <!-- 
    wrap the target element with `validity` component.
    required `field` property and `validators` property.
  -->
  <validity field="comment" :validators="{ minlength: 16, maxlength: 128 }">
    <input type="text" @input="handleInput">
  </validity>
  <div>
    <span v-show="result.minlength">Your comment is too short.</span>
    <span v-show="result.maxlength">Your comment is too long.</span>
  </div>
  <input type="submit" value="send" v-if="result.valid">
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题