fix(compiler-sfc): fix ref sugar rewrite for identifiers in ts casting expressions
fix #4254
This commit is contained in:
@@ -92,6 +92,23 @@ return { n, a, b, c }
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`<script setup> ref sugar handle TS casting syntax 1`] = `
|
||||
"import { ref as _ref, defineComponent as _defineComponent } from 'vue'
|
||||
|
||||
export default _defineComponent({
|
||||
setup(__props, { expose }) {
|
||||
expose()
|
||||
|
||||
let n = _ref<number | undefined>()
|
||||
console.log(n.value!)
|
||||
console.log(n.value as number)
|
||||
|
||||
return { n }
|
||||
}
|
||||
|
||||
})"
|
||||
`;
|
||||
|
||||
exports[`<script setup> ref sugar mixing $ref & $computed declarations 1`] = `
|
||||
"import { ref as _ref, computed as _computed } from 'vue'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user