feat: 重构 Design 组件

- 移除了未使用的 CSS 样式
-优化了组件的导入方式
- 调整了 Store 的引用
- 清理了不必要的注释
This commit is contained in:
陈昱达
2025-03-03 16:19:00 +08:00
parent 2195eab28f
commit f4013324f5
3 changed files with 14 additions and 37 deletions

2
components.d.ts vendored
View File

@@ -2,7 +2,7 @@
// @ts-nocheck // @ts-nocheck
// Generated by unplugin-vue-components // Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
export {} export {};
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {

View File

@@ -31,18 +31,3 @@ a,
.flex-start { .flex-start {
justify-content: flex-start; justify-content: flex-start;
} }
// 宽度设置
@include set-width($width-list);
// 宽度设置
@include set-height($width-list);
// 间距设置
@include set-distance($distance-class-list, $distance-list);
//圆角弧度设置
@include set-radius($radius);
//透明度设置
@include set-opacity($opacity);

View File

@@ -35,29 +35,13 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { defineAsyncComponent, ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { useCounterStore } from '@/stores/counter'; import { useCounterStore } from '@/stores/counter';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
// 获取 Store 实例 import Draggable from './components/Draggable.vue';
const counterStore = useCounterStore(); import BaseSelect from './components/Questions/BaseSelect.vue';
// 修改访问方式 import ChooseQuestion from './components/ChooseQuestion.vue';
const store = storeToRefs(counterStore); import Paging from './components/Questions/paging/Paging.vue';
// import 组件
const Draggable = defineAsyncComponent(() => {
return import('./components/Draggable.vue');
});
const BaseSelect = defineAsyncComponent(() => {
return import('./components/Questions/BaseSelect.vue');
});
const ChooseQuestion = defineAsyncComponent(() => {
return import('./components/ChooseQuestion.vue');
});
const Paging = defineAsyncComponent(() => {
return import('./components/Questions/paging/Paging.vue');
});
const chooseQuestionId = ref('');
const questionInfo = ref(storeToRefs(counterStore).questionsInfo);
/** /**
* 工具函数 * 工具函数
*/ */
@@ -104,10 +88,18 @@ function util() {
}; };
} }
const { pageIsActive } = util(); const { pageIsActive } = util();
// 获取 Store 实例
const counterStore = useCounterStore();
const store = storeToRefs(counterStore);
const chooseQuestionId = ref('');
const questionInfo = ref(store.questionsInfo.value);
// 获取选中的题目的ID // 获取选中的题目的ID
const getChooseQuestionId = (questionItem) => { const getChooseQuestionId = (questionItem) => {
chooseQuestionId.value = questionItem.id; chooseQuestionId.value = questionItem.id;
}; };
onMounted(() => { onMounted(() => {
questionInfo.value = store.questionsInfo.value; questionInfo.value = store.questionsInfo.value;
}); });