We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
小程序基础库: 2.12.1 使用框架: Vue 3
<script lang="ts"> import { defineComponent, onMounted, reactive } from "vue"; import { QustionDomain } from "../domain/QustionDomain"; export default defineComponent({ setup() { const question:QustionDomain = reactive({ id: "", title: "某用户是?", }); return { question }; }, }); </script>
这中情况下编译直接报错,在question: QuestionDomain处提示Unexpected token
<script lang="ts"> import { defineComponent, onMounted, reactive } from "vue"; import { QustionDomain } from "../domain/QustionDomain"; export default defineComponent({ setup() { /** * 当前题 */ const question = reactive({ id: "", title: "某用户是?" }) as QustionDomain; return { question }; }, }); </script>
这种情况下在as 处提示Unexpected token
<script lang="ts"> import { defineComponent, onMounted, reactive } from "vue"; import { QustionDomain } from "../domain/QustionDomain"; export default defineComponent({ setup() { /** * 当前题 */ const question = reactive<QustionDomain>({ id: "", title: "某用户是?" }); return { question }; }, }); </script>
这种情况下编译不报错,但是页面答应{{question.title}}无内容
可以支持类型限制
不支持类型限制
Taro CLI 3.0.7 environment info: System: OS: Windows 8.1 Binaries: Node: 14.7.0 - E:\Program Files\nodejs\node.EXE npm: 6.14.7 - E:\Program Files\nodejs\npm.CMD
只有在不做任何类型限制的时候,页面才可以做正确的显示
The text was updated successfully, but these errors were encountered:
duplicated #7335
Sorry, something went wrong.
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.12.1
使用框架: Vue 3
复现步骤
代码片断如下,分别列举三种情况
这中情况下编译直接报错,在question: QuestionDomain处提示Unexpected token
这种情况下在as 处提示Unexpected token
这种情况下编译不报错,但是页面答应{{question.title}}无内容
期望结果
可以支持类型限制
实际结果
不支持类型限制
环境信息
补充信息
只有在不做任何类型限制的时候,页面才可以做正确的显示
The text was updated successfully, but these errors were encountered: