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

@form-create/vant 无法自动导入vant组件样式 #741

Open
Syeeling opened this issue Nov 25, 2024 · 4 comments
Open

@form-create/vant 无法自动导入vant组件样式 #741

Syeeling opened this issue Nov 25, 2024 · 4 comments

Comments

@Syeeling
Copy link

Syeeling commented Nov 25, 2024

@form-create/vant@3.2.12

vant@4.9.7

项目中vant组件及其样式通过 unplugin-auto-import、unplugin-vue-components、@vant/auto-import-resolver这三个插件自动引入,正常使用vant组件没有问题,但是在使用form-create时,会导致vant组件样式丢失,如图:
image

main.js:
import formCreateMobile from '@form-create/vant'
import install from '@form-create/vant/auto-import'
formCreateMobile.use(install)
app.use(formCreateMobile)

index.vue:

<script setup name="Home"> const option = ref({ form: { labelWidth: '6.2em', colon: false, inputAlign: 'left', labelAlign: 'top' }, resetBtn: { show: false, innerText: '重置' }, submitBtn: { show: true, innerText: '提交' }, formName: '' }) const rule = ref([ { type: 'input', field: 'Fkntm3wd7zzsabc', title: '姓名', info: '', $required: '请输入姓名', props: { disabled: false, type: 'text', placeholder: '请输入姓名', clearable: true }, _fc_id: 'id_Fv6fm3wd7zzsacc', name: 'ref_Fadom3wd7zzsadc', display: true, hidden: false, _fc_drag_tag: 'input', class: 'user-name' }, { type: 'select', field: 'Flv9m3wdc8syaec', title: '性别', info: '', $required: '请选择性别', props: { _optionType: 2, title: '请选择性别', placeholder: '请选择性别' }, optionsTo: 'props.options', _fc_id: 'id_Fgtmm3wdc8syafc', name: 'ref_Fjhtm3wdc8syagc', display: true, hidden: false, _fc_drag_tag: 'select', options: [ { text: '男', value: 'male' }, { text: '女', value: 'female' } ] } ]) const fapi = ref(null) const formData = ref({}) const onSubmit = formData => { //todo 提交表单 } </script>

@xaboy
Copy link
Owner

xaboy commented Nov 25, 2024

不支持自动导入功能, 需要自己提前将渲染的组件导入并挂载

@Syeeling
Copy link
Author

不支持自动导入功能, 需要自己提前将渲染的组件导入并挂载

@xaboy 请问后续会有计划支持自动导入功能嘛?

@xaboy
Copy link
Owner

xaboy commented Nov 25, 2024

还需要再研究一下,不确定是否能实现

@Syeeling
Copy link
Author

还需要再研究一下,不确定是否能实现

@xaboy 好的,感谢回复🙏

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