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/src-attribute-check-in-svg/expected.js

72 lines
1.3 KiB

/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
append_hydration,
attr,
children,
claim_svg_element,
detach,
init,
insert_hydration,
noop,
safe_not_equal,
svg_element
} from "svelte/internal";
function create_fragment(ctx) {
let svg;
let img;
return {
c() {
svg = svg_element("svg");
img = svg_element("img");
this.h();
},
l(nodes) {
svg = claim_svg_element(nodes, "svg", {});
var svg_nodes = children(svg);
img = claim_svg_element(svg_nodes, "img", { alt: true, src: true });
svg_nodes.forEach(detach);
this.h();
},
h() {
attr(img, "alt", "potato");
attr(img, "src", /*url*/ ctx[0]);
},
m(target, anchor) {
insert_hydration(target, svg, anchor);
append_hydration(svg, img);
},
p(ctx, [dirty]) {
if (dirty & /*url*/ 1) {
attr(img, "src", /*url*/ ctx[0]);
}
},
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(svg);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { url } = $$props;
$$self.$$set = $$props => {
if ('url' in $$props) $$invalidate(0, url = $$props.url);
};
return [url];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { url: 0 });
}
}
export default Component;