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

运行引入的组件时,报 Do not use built-in or reserved HTML elements as component id #25

Closed
perfectyang opened this issue Sep 7, 2016 · 12 comments

Comments

@perfectyang
Copy link

perfectyang commented Sep 7, 2016

代码如下:

<template>
  <div class="y_table">
      <el-table
        :data="tableData3"
        selection-mode="multiple"
        :fixed-column-count="2"
        @selectionchange="handleSelectionChange"
        @cellclick="currentClick"
        height="600"
        border
      >
      <el-table-column
        type="selection"
        >
      </el-table-column>
      <el-table-column
          inline-template
          label="操作"
          :formatter="formatter"
          >
          <a style="color: #ff6161;">{{ row.item1 }}操作</a>
      </el-table-column>
      </el-table>
  </div>
</template>

运行结果报: [Vue warn]: Do not use built-in or reserved HTML elements as component id: Table

期望回复:这是因为缺少什么属性导致的吗,如何解决

What is actually happening?

@QingWei-Li
Copy link
Contributor

请问你是怎么注册组件的?贴一下完整代码

@perfectyang
Copy link
Author

import Element from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
Vue.use(Element)

直接在main.js里面注册

@QingWei-Li
Copy link
Contributor

Vue 和 Element 的版本号报一下

@perfectyang
Copy link
Author

"element-ui": "^1.0.0-rc.1",
"vue": "^2.0.0-rc.4",

@perfectyang
Copy link
Author

直接是你的项目里面将docs 里面用法拷过来,报这个error的

@QingWei-Li
Copy link
Contributor

刚建的项目,跟你同样的用法,只是去掉了那些方法,是正常的
image

<template>
  <div class="y_table">
    <el-table
      :data="tableData3"
      selection-mode="multiple"
      :fixed-column-count="2"
      height="600"
      border
    >
    <el-table-column type="selection">
    </el-table-column>
    <el-table-column inline-template label="操作">
        <a style="color: #ff6161;">{{ row.item1 }}操作</a>
    </el-table-column>
    </el-table>
  </div>
</template>

<script>
  import Element from 'element-ui';
  import Vue from 'vue';
  import 'element-ui/lib/theme-default/index.css';

  Vue.use(Element);

  export default {
    name: 'app',

    data() {
      return {
        tableData3: [
          { item1: 'aaa' }
        ]
      };
    }
  };
</script>

@Leopoldthecoder
Copy link
Contributor

建议全文搜索一下 tableTable,看看除了在 el-table 里是不是还在哪里出现过。

@perfectyang
Copy link
Author

好的

@perfectyang
Copy link
Author

文档什么时候能出啊

@QingWei-Li
Copy link
Contributor

完善中,快了,没具体时间

@wltony
Copy link

wltony commented Sep 8, 2016

doc 里的md已经很全了。

@perfectyang
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

4 participants