Tag Archives: Unknown custom element error

[How to Solve Vue warn]: Unknown custom element: did you register the component correctly?

Preface

Copy code
[Vue warn]: Unknown custom element:  did you register the component correctly? For recursive components, make sure to provide the "name" option.

The cause of the problem is: related components are used, but not introduced

Solutions

First find the relevant code caused the error, see if there is use similar components, such as the use radio-groupand radioassembly, but not introduced, this time above error occurs

 <el-form-item label="状态:">
      <el-radio-group v-model="formData.status">
            <el-radio :key="item.value"
            :label="item.value"
            v-for="item in statusOptions" >{{item.label}}</el-radio>
      </el-radio-group>
</el-form-item>

Found in the project directory main.js, and then import {} fromintroduced into related components, re- Vue.use()use. For example:

import {
    Radio,
    RadioGroup,
} from 'element-ui';

Vue.use(Radio);
Vue.use(RadioGroup);

This completes the global introduction of components