-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
全局样式某些特定的情况下不起作用 #1035
Comments
能否贴一下编译后的代码 |
|
应该是百度平台的问题,微信下全局样式没问题 |
遍历这个组件,不在组件里遍历,避免了这个问题,全局样式起作用了 |
同样是一个组件内,可是第一行Text的className内的label margin-t-0-6x margin-r-0-6x 起作用 ,后面map遍历的Text的className内的label margin-t-0-6x margin-r-0-6x 不起作用 ,这个避免不了啊,也找了半天,找不出问题出在哪里 |
编译后的swan |
编译后的js Object.defineProperty(exports, "__esModule", { var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; var _index = require("../../npm/@tarojs/taro-swan/index.js"); var _index2 = _interopRequireDefault(_index); var _index3 = require("../../npm/prop-types/index.js"); var _index4 = _interopRequireDefault(_index3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.proto = superClass; } var AppCompanyItem = function (_BaseComponent) { function AppCompanyItem() {
} _createClass(AppCompanyItem, [{
}]); return AppCompanyItem; AppCompanyItem.properties = { AppCompanyItem.propTypes = { exports.default = AppCompanyItem; Component(require('../../npm/@tarojs/taro-swan/index.js').default.createComponent(AppCompanyItem)); |
好的,这个问题我们再跟进下,看看能不能反馈给百度小程序的开发人员 |
嗯嗯 谢谢 |
问题描述
在自定义组件里引用全局样式,并通过static options = {addGlobalClass: true},发现有的全局样式起作用,有的全局样式不起作用!不起作用的一般带有this.props.items.map
复现步骤
[复现问题的步骤]
下面是不起作用的自定义组件代码
期望行为
全局样式起作用,哈哈,
报错信息
没有报错信息,但是样式不起作用
组件内的样式是 className='bg-white padding-1x d-flex flex-row justify-content-start'
编译运行后的样式 class="app-company-item__b-white app-company-item__padding-1x app-company-item__d-flex app-company-item__flex-row app-company-item__justify-content-start"
[这里请贴上你的完整报错截图或文字]
系统信息
补充信息
可能由于props.map
The text was updated successfully, but these errors were encountered: