Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue多页面多组件时样式未引入 #7277

Closed
tenbamboo opened this issue Aug 6, 2020 · 3 comments
Closed

Vue多页面多组件时样式未引入 #7277

tenbamboo opened this issue Aug 6, 2020 · 3 comments
Labels
F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@tenbamboo
Copy link

相关平台

微信小程序

复现仓库

https://github.com/tenbamboo/taroerror
小程序基础库: 2.12.1
使用框架: Vue 2

复现步骤

  1. clone 项目&启动

2.查看src/components/下的 BasicContainer.vue (css=>color:red)和 Comp1.vue (css=>color:blud)样式是否加载成功

期望结果

组件内的文字颜色是对应的红色和蓝色

实际结果

未显示任何颜色
image

环境信息



  Taro CLI 3.0.7 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 10.8.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.15.2 - C:\Users\***\AppData\Roaming\npm\yarn.CMD
      npm: 6.2.0 - C:\Program Files\nodejs\npm.CMD

补充信息

初步分析,是dist/common.wxss 文件未加载到全局样式中

image

分支描述

如果把app.config.js中的 pages的 'pages/index2/index'注释之后,再次重新启动服务(yarn dev:weapp),颜色就会有了如下图:

image

@taro-bot2 taro-bot2 bot added F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Aug 6, 2020
@rottenpen
Copy link
Contributor

App.js 里面要把 app.scss 传入,不然 common.wxss 不能全局打包进小程序代码里

// app.js
import './app.scss'

@tenbamboo
Copy link
Author

确实,我刚刚引入app.scss马上好用了。。。,谢谢

@rottenpen
Copy link
Contributor

嗯嗯,已经提 fix 这个问题了,后面拉 template 会自动加上。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue2 Framework - Vue 2 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

3 participants