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

63 lines
1.1 KiB

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