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

tsx中似乎无法使用defineModel #11245

Closed
Sharang-heng opened this issue Jun 28, 2024 · 2 comments
Closed

tsx中似乎无法使用defineModel #11245

Sharang-heng opened this issue Jun 28, 2024 · 2 comments

Comments

@Sharang-heng
Copy link

Vue version

3.4.27

Link to minimal reproduction

https://github.com/Sharang-heng/vue3-issue

Steps to reproduce

import { Input } from 'ant-design-vue';
export default defineComponent({
  setup() {
    const value = defineModel({
      required: true
    });
    return {
      value
    };
  },
  render() {
    return <Input v-model={this.value}></Input>;
  }
});

defineModel为宏应该不需要手动引入吧?
image

What is expected?

不需手动引入

What is actually happening?

如果手动从vue中引入的话用起来怪怪的,报undefined

System Info

No response

Any additional comments?

No response

@yangxiuxiu1115
Copy link
Contributor

@yangxiuxiu1115
Copy link
Contributor

只能在script setup语法下才能使用哟

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

No branches or pull requests

3 participants