0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/test/js/samples/dont-use-dataset-in-legacy/expected.js

51 lines
1.1 KiB
JavaScript
Raw Normal View History

/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
2018-04-28 19:41:30 +02:00
function create_main_fragment(component, ctx) {
var div, text, div_1;
return {
2018-04-30 02:07:24 +02:00
c() {
div = createElement("div");
text = createText("\n");
div_1 = createElement("div");
setAttribute(div, "data-foo", "bar");
2018-04-28 19:41:30 +02:00
setAttribute(div_1, "data-foo", ctx.bar);
},
2018-04-30 02:07:24 +02:00
m(target, anchor) {
insertNode(div, target, anchor);
insertNode(text, target, anchor);
insertNode(div_1, target, anchor);
},
2018-04-30 02:07:24 +02:00
p(changed, ctx) {
if (changed.bar) {
2018-04-28 19:41:30 +02:00
setAttribute(div_1, "data-foo", ctx.bar);
}
},
2018-04-30 02:07:24 +02:00
u() {
detachNode(div);
detachNode(text);
detachNode(div_1);
},
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
2018-02-11 14:24:55 +01:00
this._fragment = create_main_fragment(this, this._state);
if (options.target) {
this._fragment.c();
this._mount(options.target, options.anchor);
}
}
assign(SvelteComponent.prototype, proto);
2017-11-18 19:45:10 +01:00
export default SvelteComponent;