Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
blockly > DeleteArea
Class DeleteArea
Class abstrak untuk komponen yang dapat menghapus blok atau balon yang ditaruh di atasnya.
Tanda Tangan:
export declare class DeleteArea extends DragTarget implements IDeleteArea
Memperluas: DragTarget
Menerapkan: IDeleteArea
Konstruktor
Konstruktor |
Pengubah |
Deskripsi |
(konstruktor)() |
|
Konstruktor untuk DeleteArea. Tidak boleh dipanggil secara langsung, hanya dengan subclass. |
Properti
Properti |
Pengubah |
Jenis |
Deskripsi |
id |
|
string |
ID unik untuk komponen ini yang digunakan untuk mendaftar ke ComponentManager. |
wouldDelete_ |
protected |
boolean |
Apakah blok atau balon terakhir yang ditarik di atas area hapus ini akan dihapus jika diletakkan pada komponen ini. Properti ini tidak diperbarui setelah blok atau balon dihapus. |
Metode
Metode |
Pengubah |
Deskripsi |
updateWouldDelete_(wouldDelete) |
protected |
Memperbarui status willDelete_ internal. |
wouldDelete(element) |
|
Menampilkan apakah blok atau balon yang diberikan akan dihapus jika ditempatkan di area ini. Metode ini akan memeriksa apakah elemen dapat dihapus dan selalu dipanggil sebelum onDragEnter/onDragOver/onDragExit. |
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-08-22 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2024-08-22 UTC."],[[["The `DeleteArea` class in Blockly manages the deletion of blocks or bubbles dropped onto it."],["It's an abstract class extending `DragTarget` and implementing `IDeleteArea`, meant to be subclassed."],["It uses a `wouldDelete_` property to track if a dragged element would be deleted upon release."],["The `wouldDelete` method determines if a given element is deletable when dragged over the area."],["It provides `updateWouldDelete_` to manage the internal deletion state."]]],["The `DeleteArea` class, extending `DragTarget` and implementing `IDeleteArea`, manages the deletion of blocks or bubbles. It features a constructor and properties like `id` and `wouldDelete_`, the later tracking whether a dragged element would be deleted if dropped. Key methods include `updateWouldDelete_`, which manages the `wouldDelete_` state, and `wouldDelete`, determining if a dragged element is deletable. This class does not allow being directly instantiated, only used through subclasses.\n"]]