JavaScript textarea output

博客提及了开发库相关内容,但信息较少。开发库在信息技术领域有重要作用,可助力开发工作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<html>

<head>
    <title>class</title>

</head>

<body>

    <h1>Class</h1>
    <textarea id='out'></textarea>

    <script type="text/javascript" src='../core/xy.js'></script>
    <script type="text/javascript">
        function Output(n) {
            this.base(n);
        }
        //Output extends Dom
        xy.ext(Output, xy.Dom);
        var out_impl = {
            /**
             * @override
             * 
             */
            value(s) {
                s = s && this.kv('value', s);
                s = s || this.k('value');
                return s;
            },
            println(s) {
                //text use value
                //error
                // this.value(this.value() + "\n" + s.toString() + "\n");
                //value property OK!
                // this.kv('value', this.k('value') + "\n" + s.toString() + "\n");
                this.value(this.value() + '\n' + s.toString() + '\n');
            },
        };
        // console.log(xy.ext_interfaces.from_interface);
        //Output implementation
        xy.impl(Output, out_impl);
        //Output static implementation
        xy.static_impl(Output, xy.std_interfaces.of_interface, xy.ext_interfaces.from_interface);
        xy(() => {
            function A(a) {
                this.a = a;
            }
            function B(a, b) {
                this.base(a);
                this.b = b;
            }
            function C(a, b, c) {
                this.base(a, b);
                this.c = c;
            }
            function D(a, b, c, d) {
                this.base(a, b, c);
                this.d = d;
            }
            function E(e = 'E') {
                this.base('A', 'B', 'C', 'D');
                this.e = e;
            }
            function F(f = 'F') {
                this.base();
                this.f = f;
            }
            var A_impl = {
                toString() {
                    return JSON.stringify(this);
                }
            };
            xy.impl(A, A_impl);
            xy.static_impl(A, xy.std_interfaces.of_interface);
            xy.ext(F, E, D, C, B, A);
            let out = Output.from('#out');
            out.attr('rows', 30).attr('cols', 30);
            out.println(new E());
            out.println(E.of());
            out.println(new F());
            out.println(F.of());
            let f = new F();
            // console.log(JSON.stringify(f));
            out.println("f instanceof A:" + xy.inst_of(f, A));
            out.println("f instanceof B:" + xy.inst_of(f, B));
            out.println("f instanceof C:" + xy.inst_of(f, C));
            out.println("f instanceof D:" + xy.inst_of(f, D));
            out.println("f instanceof E:" + xy.inst_of(f, E));
            out.println("f instanceof F:" + xy.inst_of(f, F));
        });
    </script>
</body>

</html>

 

 

library(developing)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值