Browse Source

feat: 全局样式引入并生效

菲鸽 2 years ago
parent
commit
adab851dd4
3 changed files with 10 additions and 1 deletions
  1. 1 0
      src/main.ts
  2. 5 1
      src/pages-sub/demo/index.vue
  3. 4 0
      src/style/index.scss

+ 1 - 0
src/main.ts

@@ -5,6 +5,7 @@ import store from './store'
 import i18n from './locale/index'
 import 'virtual:svg-icons-register'
 import 'virtual:uno.css'
+import '@/style/index.scss'
 
 export function createApp() {
   const app = createSSRApp(App)

+ 5 - 1
src/pages-sub/demo/index.vue

@@ -5,7 +5,11 @@
 </route>
 
 <template>
-  <view class="text-green-500 text-center">分包页面demo</view>
+  <view class="text-center">
+    <view class="m-8"> http://localhost:9000/#/pages-sub/demo/index </view>
+    <view class="text-green-500"> 分包页面demo </view>
+    <view class="test">test global css</view>
+  </view>
 </template>
 
 <script lang="ts" setup>

+ 4 - 0
src/style/index.scss

@@ -0,0 +1,4 @@
+.test {
+  margin-top: 4px;
+  color: red;
+}