Survei Riset: Ceritakan pengalaman Anda dengan Blockly
Mulai survei
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
blockly > blockRendering > PathObject > setClass_
Metode blockRendering.PathObject.setClass_()
Tambahkan atau hapus class CSS yang diberikan pada elemen SVG root objek jalur.
Tanda Tangan:
protected setClass_(className: string, add: boolean): void;
Parameter
Parameter |
Jenis |
Deskripsi |
className |
string |
Nama class yang akan ditambahkan atau dihapus |
tambahkan |
boolean |
True jika class harus ditambahkan. False jika harus dihapus. |
Hasil:
void
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-21 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-21 UTC."],[[["The `blockRendering.PathObject.setClass_()` method allows you to dynamically add or remove CSS classes on a path object's root SVG element."],["This method accepts two parameters: `className` (string) specifying the class name and `add` (boolean) indicating whether to add or remove the class."],["Utilizing this method enables you to control the styling and appearance of path objects within Blockly's block rendering system."]]],["The `setClass_()` method of the `PathObject` in the `blockRendering` namespace adds or removes a CSS class on the root SVG element. It takes two parameters: `className` (the class name) and `add` (a boolean indicating whether to add or remove the class). If `add` is true, the class is added; if false, it's removed. This method returns void.\n"]]