动态引入scss

develop
jialong.yu 3 years ago
parent ac4ebb1c19
commit 81720cc305
  1. 4
      src/components/TestPanel.vue
  2. 22
      src/main.js

@ -134,7 +134,7 @@ import util from '@/util'
export default { export default {
data() { data() {
return { return {
systemId: util.getCookie('systemId'), systemId: util.getCookie('systemId') ? Number(util.getCookie('systemId')) : 1,
classId: util.getCookie('classId'), classId: util.getCookie('classId'),
className: util.getCookie('className') ? decodeURI(util.getCookie('className')) : '', className: util.getCookie('className') ? decodeURI(util.getCookie('className')) : '',
courseId: util.getCookie('courseId'), courseId: util.getCookie('courseId'),
@ -413,7 +413,7 @@ export default {
projectName, projectName,
assessmentId: this.assessmentId ? this.assessmentId : '', assessmentId: this.assessmentId ? this.assessmentId : '',
totalScore: 100, // 100 totalScore: 100, // 100
systemId: 1, systemId: this.systemId,
purpose: this.experimentTarget, // purpose: this.experimentTarget, //
attributesReqList attributesReqList
} }

@ -5,24 +5,10 @@ import store from "./store";
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import util from '@/util' import util from '@/util'
import '@/styles/index.scss'; import '@/styles/index.scss';
const systemId = util.getCookie('systemId') const systemId = util.getCookie('systemId') ? Number(util.getCookie('systemId')) : 1
if (systemId == 1) { console.log('main', systemId, `@/styles/theme/theme${systemId}.scss`)
require('@/styles/theme/theme1.scss') // require(`@/styles/theme/theme${systemId}.scss`)
} else if (systemId == 4) { require(`@/styles/theme/theme1.scss`)
require('@/styles/theme/theme4.scss')
} else if (systemId == 5) {
require('@/styles/theme/theme5.scss')
} else if (systemId == 6) {
require('@/styles/theme/theme6.scss')
} else if (systemId == 7) {
require('@/styles/theme/theme7.scss')
} else if (systemId == 8) {
require('@/styles/theme/theme8.scss')
} else if (systemId == 9) {
require('@/styles/theme/theme9.scss')
} else if (systemId == 10) {
require('@/styles/theme/theme10.scss')
}
import api from './api'; import api from './api';
import { import {
post, post,

Loading…
Cancel
Save