Subscribe on changes!

<template> can not find the variable when i use destructuring assignment in the <script setup>

avatar
Sep 9th 2021

Version

3.2.9

Reproduction link

sfc.vuejs.org/

Steps to reproduce

import { SETTING } from '@/store/config/modules';  // SETTING is string

const store = useStore();
const { [`${SETTING}/questionTypeCascade`]: questionTypeCascade } = store.getters;
//  can't use questionTypeCascade in <template>

What is expected?

can use the variable

What is actually happening?

can't find the variable