Closed lsdsjy closed 2 years ago
Thanks for your contribution!
Do you have interest to add a test case for this PR?
You can refer to these commit and make another PR:
Yeah sure. See #27 Don't know if the test case description is clear enough though.
@lsdsjy also we need support foo?.bar.c ?? d?.(e)?.[f]
.
@lsdsjy also we need support
foo?.bar.c ?? d?.(e)?.[f]
.
@xiaoxiangmoe Thank you for your feedback, I just tried the code below:
<template>
<div id="app">
<h1>2021年12月02日11:05:55</h1>
<h2>{{obj?.prop.nullish ?? optional?.(chainingKey)?.[chainingKey]}}</h2>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
optional: function (key) {
console.log(key) // 'chainingKey'
return {
chainingKey: 'inner chainingKey'
}
},
obj: {
prop: {
nullish: null,
}
},
chainingKey: 'chainingKey',
}
}
}
</script>
It works find after this PR:
I will publish a new version later, try it.
If you still have any problem, open an issue or comment, just let me know.
v1.0.7 just published after this PR.
You can try it by:
npm install vue-template-babel-compiler --save-dev
// or
yarn add vue-template-babel-compiler --save-dev
This case should be consistent with the MemberExpression case, where Identifiers in computed OptionalMemberExpression Property should be prepended with "vm".