跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[问与答] 想咨询一个前端代码结构优化的思路

发表于
现在项目界面里有很多选项和按钮, 随着需求不断增加, 产生各种联动的代码, 比如 A 选项有 A1,A2,A3, 选择 A1, B 选项出现, 选择 A2, C 选项出现, 选择 A3, BC 选项但是同时选项列表里要把 B1 置为 disable 禁止选择, 有可能还有 D 的联动影响到了 A1.
现在开发的思路就是断点读代码, 有新需求联动就在上面再加一行, 因为还有很多异步操作, 很多时候不知道哪里就蹦出来个史前需求改了这条数据, 有什么比较优雅的方法处理这种联动控制吗? 项目里也不存在单向数据里这种东西,全在 data 下面或者用 mixin 引入, 每个代码都有直接修改数据的能力, 太可怕了

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.