方案二(可行):ViewModel 中定义MutableLiveData,Composable 中使用observeAsState 监听LiveData 的变化。 示例代码. ViewModel 中: var currentItem = ...
確定! 回上一頁