feat: 重构 Design 组件
- 移除了未使用的 CSS 样式 -优化了组件的导入方式 - 调整了 Store 的引用 - 清理了不必要的注释
This commit is contained in:
2
components.d.ts
vendored
2
components.d.ts
vendored
@@ -2,7 +2,7 @@
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
export {}
|
||||
export {};
|
||||
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
|
||||
@@ -31,18 +31,3 @@ a,
|
||||
.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);
|
||||
|
||||
@@ -35,29 +35,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { defineAsyncComponent, ref, onMounted } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useCounterStore } from '@/stores/counter';
|
||||
import { storeToRefs } from 'pinia';
|
||||
// 获取 Store 实例
|
||||
const counterStore = useCounterStore();
|
||||
// 修改访问方式
|
||||
const store = storeToRefs(counterStore);
|
||||
// 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);
|
||||
import Draggable from './components/Draggable.vue';
|
||||
import BaseSelect from './components/Questions/BaseSelect.vue';
|
||||
import ChooseQuestion from './components/ChooseQuestion.vue';
|
||||
import Paging from './components/Questions/paging/Paging.vue';
|
||||
/**
|
||||
* 工具函数
|
||||
*/
|
||||
@@ -104,10 +88,18 @@ function util() {
|
||||
};
|
||||
}
|
||||
const { pageIsActive } = util();
|
||||
// 获取 Store 实例
|
||||
const counterStore = useCounterStore();
|
||||
const store = storeToRefs(counterStore);
|
||||
|
||||
const chooseQuestionId = ref('');
|
||||
const questionInfo = ref(store.questionsInfo.value);
|
||||
|
||||
// 获取选中的题目的ID
|
||||
const getChooseQuestionId = (questionItem) => {
|
||||
chooseQuestionId.value = questionItem.id;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
questionInfo.value = store.questionsInfo.value;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user