feat: 🎸 vite 配置全局的scss 的样式mixin 混入

This commit is contained in:
vintonhuang 2022-08-19 14:49:18 +08:00
parent a25eac9b7a
commit fffc668e29
4 changed files with 4 additions and 5 deletions

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -13,7 +13,7 @@
</nut-cell-group>
<nut-cell-group :title="$t('home.cssMultiLanguage')" class="supportList">
<nut-cell>
<div :class="['btn-add', i18n.global.locale]"></div>
<div :class="['btn-confirm', i18n.global.locale]"></div>
</nut-cell>
</nut-cell-group>
<div class="btn-wrap">
@ -43,7 +43,6 @@
};
</script>
<style lang="scss">
@import '../../styles/mixin.scss';
.header {
display: flex;
justify-content: center;
@ -78,7 +77,7 @@
.btn-wrap {
margin: 20px;
}
.btn-add {
@include main-lang-bg(302px, 82px, '/@/assets/button', 'add.png');
.btn-confirm {
@include main-lang-bg(302px, 82px, '/@/assets/button', 'confirm.png');
}
</style>

View File

@ -39,7 +39,7 @@ export default function ({ command }: ConfigEnv): UserConfigExport {
preprocessorOptions: {
scss: {
// 配置 nutui 全局 scss 变量
additionalData: `@import "@nutui/nutui/dist/styles/variables.scss";`,
additionalData: `@import "@nutui/nutui/dist/styles/variables.scss";@import '/@/styles/mixin.scss';`,
},
},
},