You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/js/samples/select-dynamic-value/expected.js

68 lines
1.3 KiB

5 years ago
/* generated by Svelte vX.Y.Z */
6 years ago
import {
SvelteComponent,
6 years ago
append,
detach,
element,
init,
insert,
noop,
safe_not_equal,
select_option,
set_input_value
6 years ago
} from "svelte/internal";
function create_fragment(ctx) {
let select;
let option0;
let option1;
return {
c() {
6 years ago
select = element("select");
option0 = element("option");
option0.textContent = "1";
6 years ago
option1 = element("option");
option1.textContent = "2";
option0.__value = "1";
set_input_value(option0, option0.__value);
option1.__value = "2";
set_input_value(option1, option1.__value);
},
m(target, anchor) {
insert(target, select, anchor);
append(select, option0);
append(select, option1);
select_option(select, /*current*/ ctx[0]);
},
p(ctx, [dirty]) {
if (dirty & /*current*/ 1) {
select_option(select, /*current*/ ctx[0]);
}
},
i: noop,
o: noop,
6 years ago
d(detaching) {
if (detaching) detach(select);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { current } = $$props;
$$self.$$set = $$props => {
if ('current' in $$props) $$invalidate(0, current = $$props.current);
};
return [current];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { current: 0 });
}
}
export default Component;