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

自定义组件未能正确渲染 #219

Open
Bai-Xiaoguang opened this issue Feb 17, 2023 · 1 comment
Open

自定义组件未能正确渲染 #219

Bai-Xiaoguang opened this issue Feb 17, 2023 · 1 comment

Comments

@Bai-Xiaoguang
Copy link

这个样例里的自定义组件MySelect和MyCheckbox为什么没有正确渲染呢?

@cjboy76
Copy link

cjboy76 commented May 17, 2023

One possible solution here,
you can replace the string name with registered component Object.

import MySelect from './MySelect.vue'
import MyCheckbox from './MyCheckbox.vue'
 

const configs = [
  {
    type: MySelect,
    options: [
      {label: '下拉选项1', value: 'select1'},
      {label: '下拉选项2', value: 'select2'},
      {label: '下拉选项3', value: 'select3'},
    ]
  },
  {
    type: MyCheckbox,
    options: [
      {label: '复选选项1', value: 'checkbox1'},
      {label: '复选选项2', value: 'checkbox2'},
      {label: '复选选项3', value: 'checkbox3'},
    ]
  },
]

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