mirror of https://github.com/sveltejs/svelte
parent
ac34d5aa43
commit
9f824ae744
@ -0,0 +1,65 @@
|
|||||||
|
/* generated by Svelte vX.Y.Z */
|
||||||
|
import {
|
||||||
|
SvelteComponent,
|
||||||
|
attr,
|
||||||
|
detach,
|
||||||
|
element,
|
||||||
|
init,
|
||||||
|
insert,
|
||||||
|
listen,
|
||||||
|
noop,
|
||||||
|
safe_not_equal,
|
||||||
|
set_input_value
|
||||||
|
} from "svelte/internal";
|
||||||
|
|
||||||
|
function create_fragment(ctx) {
|
||||||
|
var input, dispose;
|
||||||
|
|
||||||
|
return {
|
||||||
|
c() {
|
||||||
|
input = element("input");
|
||||||
|
attr(input, "type", "text");
|
||||||
|
dispose = listen(input, "input", ctx.input_input_handler);
|
||||||
|
},
|
||||||
|
|
||||||
|
m(target, anchor) {
|
||||||
|
insert(target, input, anchor);
|
||||||
|
|
||||||
|
set_input_value(input, ctx.value);
|
||||||
|
},
|
||||||
|
|
||||||
|
p(changed, ctx) {
|
||||||
|
if (changed.value && (input.value !== ctx.value)) set_input_value(input, ctx.value);
|
||||||
|
},
|
||||||
|
|
||||||
|
i: noop,
|
||||||
|
o: noop,
|
||||||
|
|
||||||
|
d(detaching) {
|
||||||
|
if (detaching) {
|
||||||
|
detach(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function instance($$self, $$props, $$invalidate) {
|
||||||
|
let value;
|
||||||
|
|
||||||
|
function input_input_handler() {
|
||||||
|
$$invalidate('value', value = this.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { value, input_input_handler };
|
||||||
|
}
|
||||||
|
|
||||||
|
class Component extends SvelteComponent {
|
||||||
|
constructor(options) {
|
||||||
|
super();
|
||||||
|
init(this, options, instance, create_fragment, safe_not_equal, []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Component;
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
let value;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<input type="text" bind:value={value}>
|
Loading…
Reference in new issue