-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
defineModel 无法使用,提示 "useModel" is not exported #4827
Comments
+1 |
3 similar comments
+1 |
+1 |
+1 |
@fxy060608 h5可以使用了, 但是微信小程序还是不行 |
有朋友测过了? |
我测试微信小程序,运行 ok,可以参考下面 demo 运行 https://gitcode.net/xiurensha5731/uni-app-questions/-/blob/main/src/pages/index/index.vue index page <template>
<div>
<div>你输入了:{{ str }}</div>
<myInput v-model:count="str"></myInput>
</div>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import myInput from "../../components/my-input.vue";
const str = ref("2");
</script> 对应组件 my-input <template>
<div>
<input
type="text"
v-model="count"
style="height: 20px; border: 1px solid black"
/>
</div>
</template>
<script lang="ts" setup>
const count = defineModel<string>("count", { default: "" });
</script>
<style></style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"useModel" is not exported by "node_modules/.pnpm/@dcloudio+uni-mp-vue@3.0.0-alpha-4010120240403003/node_modules/@dcloudio/uni-mp-vue/dist/vue.runtime.esm.js", imported by "src/components/categories/CategoryScrollSelector.vue?vue&type=script&setup=true&lang.ts".
at components/categories/CategoryScrollSelector.vue:1:9
1: import { useModel as _useModel, defineComponent as _defineComponent } from 'vue'
^
2: import { unref as _unref, toDisplayString as _toDisplayString, t as _t, o as _o, f as _f, n as _n } from "vue"
The text was updated successfully, but these errors were encountered: