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

就一个问题 #18

Closed
yautah opened this issue Dec 28, 2018 · 4 comments
Closed

就一个问题 #18

yautah opened this issue Dec 28, 2018 · 4 comments

Comments

@yautah
Copy link

yautah commented Dec 28, 2018

首先做的很不错
其次,这套wxss样式只能用在page层级
在自定义组件的wxml中基本无法使用
自定义组件的wxss中诸多的选择器限制是个麻烦

@wen-gang
Copy link
Collaborator

微信官方限制,page层样式传不到组件,不然2.0就做做封装组件了

@yautah
Copy link
Author

yautah commented Dec 28, 2018

有什么好的思路么?
其实一直也有想法去做一套common wxss,然后肯定要重写不少tag和attributes,但是发现自定义组件里面没法用啊。。。

@yautah
Copy link
Author

yautah commented Dec 28, 2018

我去。。。
刚才仔细看了文档
/* 组件 custom-component.js */ Component({ options: { addGlobalClass: true, } })

这样就可以使用全局样式了
感觉发现了新世界

@zenghao0219
Copy link

我去。。。
刚才仔细看了文档
/* 组件 custom-component.js */ Component({ options: { addGlobalClass: true, } })

这样就可以使用全局样式了
感觉发现了新世界
找到了 感谢!
https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants