how to use ...toRefs(state) in <script lang="ts" setup> #6203
Answered
by
liulinboyi
html580
asked this question in
Help/Questions
-
<script lang="ts" setup>
import { ref, toRefs, reactive} from 'vue';
const state = reactive({
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 弹出层标题
title: '',
// 总条数
total: 0
});
const { single, total, ids, loading, title } = toRefs(state);
</script>
must val but i dont want setup(props, { emit }) { |
Beta Was this translation helpful? Give feedback.
Answered by
liulinboyi
Jul 2, 2022
Replies: 1 comment
-
There are To make it easier to viewing and solve the problem, next time you ask a question, I think you can format the code, thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
LinusBorg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are
<script lang="ts" setup>
example and<script lang="ts">
example, hopes can help you.To make it easier to viewing and solve the problem, next time you ask a question, I think you can format the code, thanks!