Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
blockly > serialization > variables > VariableSerializer > save
Phương thức serialization.variables.VariableSerializer.save()
Tạo tuần tự các biến của không gian làm việc đã cho.
Chữ ký:
save(workspace: Workspace): IVariableState[] | null;
Thông số
Thông số |
Loại |
Mô tả |
không gian làm việc |
Workspace |
Không gian làm việc để lưu các biến. |
Trả về:
IVariableState[] | null
Trạng thái của các biến trong không gian làm việc hoặc rỗng nếu không có biến nào.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],["The `VariableSerializer.save()` method serializes a workspace's variables. It accepts a `Workspace` object as input and returns an array of `State` objects representing the serialized variables. If the workspace contains no variables, the method returns `null`. This method's core action is to capture the state of variables within a specified workspace and represent them in a serializable format.\n"]]