动态引入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 {
data() {
return {
systemId: util.getCookie('systemId'),
systemId: util.getCookie('systemId') ? Number(util.getCookie('systemId')) : 1,
classId: util.getCookie('classId'),
className: util.getCookie('className') ? decodeURI(util.getCookie('className')) : '',
courseId: util.getCookie('courseId'),
@ -413,7 +413,7 @@ export default {
projectName,
assessmentId: this.assessmentId ? this.assessmentId : '',
totalScore: 100, // 100
systemId: 1,
systemId: this.systemId,
purpose: this.experimentTarget, //
attributesReqList
}

@ -5,24 +5,10 @@ import store from "./store";
import ElementUI from 'element-ui'
import util from '@/util'
import '@/styles/index.scss';
const systemId = util.getCookie('systemId')
if (systemId == 1) {
require('@/styles/theme/theme1.scss')
} else if (systemId == 4) {
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')
}
const systemId = util.getCookie('systemId') ? Number(util.getCookie('systemId')) : 1
console.log('main', systemId, `@/styles/theme/theme${systemId}.scss`)
// require(`@/styles/theme/theme${systemId}.scss`)
require(`@/styles/theme/theme1.scss`)
import api from './api';
import {
post,

Loading…
Cancel
Save