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组件提示:Failed to resolve directive: ant-ref #20

Closed
xiaozhu188 opened this issue May 14, 2018 · 7 comments
Closed
Labels

Comments

@xiaozhu188
Copy link

import Vue from 'vue';
import { Button,Form } from 'vue-antd-ui';
Vue.component(Button.name, Button);

Vue.component(Form.name, Form);
Vue.component(Form.Item.name, Form.Item);
复制运行了登录的demo。

@tangjinzhou
Copy link
Member

tangjinzhou commented May 14, 2018

Form用到了一个全局指令,导致该提示
两种临时解决方案:

  1. 引入Modal组件并注册,这个组件会自动引入指令并注册
  2. 手动引入指令并注册
    import ref from 'vue-ref';
Vue.use(ref, { name: 'ant-ref' });

下个版本0.5.2会添加Form自动注册该指令功能

@xiaozhu188
Copy link
Author

不用jsx语法如果使用form的验证功能,希望能添加一些demo.

@Lack30
Copy link

Lack30 commented May 21, 2018

现在有不用jsx语法实现form验证的demo了吗?

@tangjinzhou
Copy link
Member

@tangjinzhou
Copy link
Member

问题已解决,可以更新到最新版

@tangjinzhou
Copy link
Member

ref #103
如果使用了dll 等 确保 使用的是同一份 vue文件 vue/dist/vue.esm.js

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants