mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
fix: compile fail for web
This commit is contained in:
parent
93405c2a40
commit
dfc69c0905
3 changed files with 7 additions and 0 deletions
|
@ -17,6 +17,9 @@ extern "C" {
|
|||
#[wasm_bindgen(method)]
|
||||
pub fn PushRoot(this: &Interpreter, root: u64);
|
||||
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn PopRoot(this: &Interpreter);
|
||||
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn AppendChildren(this: &Interpreter, many: u32);
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ export class Interpreter {
|
|||
const node = this.nodes[root];
|
||||
this.stack.push(node);
|
||||
}
|
||||
PopRoot() {
|
||||
this.stack.pop();
|
||||
}
|
||||
AppendChildren(many) {
|
||||
let root = this.stack[this.stack.length - (1 + many)];
|
||||
let to_add = this.stack.splice(this.stack.length - many);
|
||||
|
|
|
@ -105,6 +105,7 @@ impl WebsysDom {
|
|||
for edit in edits.drain(..) {
|
||||
match edit {
|
||||
DomEdit::PushRoot { root } => self.interpreter.PushRoot(root),
|
||||
DomEdit::PopRoot {} => self.interpreter.PopRoot(),
|
||||
DomEdit::AppendChildren { many } => self.interpreter.AppendChildren(many),
|
||||
DomEdit::ReplaceWith { root, m } => self.interpreter.ReplaceWith(root, m),
|
||||
DomEdit::InsertAfter { root, n } => self.interpreter.InsertAfter(root, n),
|
||||
|
|
Loading…
Reference in a new issue