diff --git a/src/pages/basic/button/index.js b/src/pages/basic/button/index.js index 40886acf0..9a932804f 100644 --- a/src/pages/basic/button/index.js +++ b/src/pages/basic/button/index.js @@ -12,7 +12,7 @@ export default class ButtonPage extends Taro.Component { } onButtonClick () { - const content = arguments.length === 2 ? arguments[0] : '' + const content = [...arguments].find(item => typeof item === 'string') const ENV = Taro.getEnv() if (ENV === 'WEAPP') Taro.showModal({ content: content || '您点击了!', showCancel: false }) else if (ENV === 'WEB') alert(content || '您点击了!')