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/data-attribute/expected.js

64 lines
1.1 KiB

/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
attr,
detach,
element,
init,
insert,
noop,
safe_not_equal,
space
} from "svelte/internal";
function create_fragment(ctx) {
let div0;
let t;
let div1;
return {
c() {
div0 = element("div");
t = space();
div1 = element("div");
attr(div0, "data-foo", "bar");
attr(div1, "data-foo", /*bar*/ ctx[0]);
},
m(target, anchor) {
insert(target, div0, anchor);
insert(target, t, anchor);
insert(target, div1, anchor);
},
p(ctx, [dirty]) {
if (dirty & /*bar*/ 1) {
attr(div1, "data-foo", /*bar*/ ctx[0]);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(div0);
if (detaching) detach(t);
if (detaching) detach(div1);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { bar } = $$props;
$$self.$set = $$props => {
if ("bar" in $$props) $$invalidate(0, bar = $$props.bar);
};
return [bar];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { bar: 0 });
}
}
export default Component;