diff --git a/DebugInfos.js b/DebugInfos.js index 78e9e433a2..602043725d 100644 --- a/DebugInfos.js +++ b/DebugInfos.js @@ -618,8 +618,6 @@ if (CC_DEBUG) { "8301": "Camera does not support Canvas Mode.", //cc.Camera.enabled // AudioEngine: 8400 "8400": "Wrong type arguments, 'filePath' must be a String.", // cc.audioEngine.play - // ToggleGroup: 8500 - "8500": "The ToggleGroup.toggleItems api will be removed in v2.0, please obtain toggles in other ways. \uD83D\uDE30", }; cc._LogInfos = logs; } diff --git a/cocos2d/core/components/CCToggleGroup.js b/cocos2d/core/components/CCToggleGroup.js index 6035b0f60d..6a53c0a03a 100644 --- a/cocos2d/core/components/CCToggleGroup.js +++ b/cocos2d/core/components/CCToggleGroup.js @@ -54,6 +54,17 @@ var ToggleGroup = cc.Class({ tooltip: CC_DEV && 'i18n:COMPONENT.toggle_group.allowSwitchOff', default: false }, + + /** + * !#en Read only property, return the toggle items array reference managed by toggleGroup. + * !#zh 只读属性,返回 toggleGroup 管理的 toggle 数组引用 + * @property {Array} toggleItems + */ + toggleItems: { + get: function () { + return this._toggleItems; + } + } }, updateToggles: function (toggle) { @@ -112,14 +123,6 @@ var ToggleGroup = cc.Class({ start: function () { this._makeAtLeastOneToggleChecked(); } - -}); - -var JS = require('../platform/js'); - -JS.get(ToggleGroup.prototype, 'toggleItems', function () { - cc.warnID(8500); - return this._toggleItems; }); cc.ToggleGroup = module.exports = ToggleGroup;