[Java] 纯文本查看 复制代码
/* App.svelte generated by Svelte v3.22.2 */
import {
SvelteComponent,
append,
detach,
element,
init,
insert,
listen,
noop,
safe_not_equal,
set_data,
space,
text
} from "svelte/internal";
function create_fragment(ctx) {
let button;
let t0;
let t1;
let t2;
let t3_value = (/*count*/ ctx[0] === 1 ? "time" : "times") + "";
let t3;
let t4;
let p;
let t5;
let t6;
let t7;
let dispose;
return {
c() {
button = element("button");
t0 = text("Clicked ");
t1 = text(/*count*/ ctx[0]);
t2 = space();
t3 = text(t3_value);
t4 = space();
p = element("p");
t5 = text(/*count*/ ctx[0]);
t6 = text(" doubled is ");
t7 = text(/*doubled*/ ctx[1]);
},
m(target, anchor, remount) {
insert(target, button, anchor);
append(button, t0);
append(button, t1);
append(button, t2);
append(button, t3);
insert(target, t4, anchor);
insert(target, p, anchor);
append(p, t5);
append(p, t6);
append(p, t7);
if (remount) dispose();
dispose = listen(button, "click", /*handleClick*/ ctx[2]);
},
p(ctx, [dirty]) {
if (dirty & /*count*/ 1) set_data(t1, /*count*/ ctx[0]);
if (dirty & /*count*/ 1 && t3_value !== (t3_value = (/*count*/ ctx[0] === 1 ? "time" : "times") + "")) set_data(t3, t3_value);
if (dirty & /*count*/ 1) set_data(t5, /*count*/ ctx[0]);
if (dirty & /*doubled*/ 2) set_data(t7, /*doubled*/ ctx[1]);
},
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(button);
if (detaching) detach(t4);
if (detaching) detach(p);
dispose();
}
};
}
function instance($$self, $$props, $$invalidate) {
let count = 0;
function handleClick() {
$$invalidate(0, count += 1);
}
let doubled;
$$self.$$.update = () => {
if ($$self.$$.dirty & /*count*/ 1) {
$: $$invalidate(1, doubled = count * 2);
}
};
return [count, doubled, handleClick];
}
class App extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, {});
}
}
export default App;