8 Star 58 Fork 9

BugDuck/tntjs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

TNT.js

License version Star Fork watch OSCS Status

website ProjectWebsite BiliBili

TNT.js

The JavaScript framework for modern web.This is a front-end framework that can control multiple pages. Writing JavaScript is like writing back-end code, which truly realizes efficient native development. In addition, we will add native component writing and debugging in future versions.

Roadmap

Please refer to TNT.js Roadmap.

Demo

Install tntjs

Although tntjs is a more native front-end framework, you can still install them using a package manager just like any other framework

First we need a project directory, assuming you are developing in a Linux environment, let's create a new MyFirstTNTJsProject

$ mkdir MFTJP #here is the abbreviation
$ cd MFTJP
$ code ./

Then let's install it

$ npm install tntjs #npm
$ yarn add tntjs #yarn
$ pnpm install tntjs #pnpm

Or you can also use the files on the cdn

https://cdn.jsdelivr.net/npm/tntjs@latest/dist/src/index.js

How to use?

Now you can happily control multiple pages with tntjs!

Next, let's write the simplest Hello world. tntjs uses <v> to realize the two-way binding of responsive variables and pages, that is to say, the value bound on the page will change as the variable changes.

<v data="variableName"/>

Fill in the expression in the data attribute

The js part needs to instantiate a TNTApp

export const app = new TNTApp();

Then use page to preset the page:

// App.js
export const app = new TNTApp();

app.page({
  data: {
    x: "Hello world!"
  },
  mount: document.getElementById("app")
}, "id1")
  • Each html file has a separate pageid, you can use <page-id> to set it in <head>, which is the page identifier for tntjs multi-page programming
<page-id>page1</page-id>
  • Use data in the first parameter to set the initial value of the responsive variable
  • The first parameter uses mount to specify the Element object of the scope of the tntjs application (the specified node can only have one child node)

Now, Import it in html file

<!DOCTYPE html>
<html lang="en">
<head>
  <script src="./App.js" type="module"></script>
  <title>tntjs demo</title>
  <page-id>id1</page-id>
</head>
<body>
  <div id="root">
    <div>
      <v data="x"></v>
    </div>
  </div>
</body>
</html>

Open it in browser, You can see:

Hello world!

Documentation

Please refer to https://tnt.js.org for more information.

Sponsoring

We're all middle school students and we don't have that much money. So sponsoring TNTjs will give us an extra reward to let us keep updating!😉

Sponsor us on ZhiFuBao Sponsor us on WeChat

Contributors

  • Emoji guidelines:
    • :star: : Community administrator
    • :pen: : Major contributor
    • :student: : Student
Acbox samzhangjy mono 27Onion 鸭 Rotten-LKZ
箱子Acbox
:star: :pen: :student:
samzhangjy
:star: :pen: :student:
mono
:star: :pen:
27Onion
:pen: :student:
leonfyr
:pen: :student:
Rotten-LKZ
:student:

Changelog

Development Stage

  • 2022.4.1 开始在学校构思
  • 2022.4.5 项目启动
  • 2022.4.9 <v></v>标签功能实现
  • 2022.4.10 变量赋值功能实现(TNTScript已废弃)
  • 2022.4.17 函数调用功能实现
  • 2022.4.24 TypeScript 重构项目
  • 2022.5.22 项目重构完成
  • 2022.5.29 发布 0.1.0 版本
  • 2022.5.29 取消发布 0.1.0 版本
  • 2022.6.9 ES6重构完成
  • 2022.7.1 开发者们都放暑假啦!恢复开发
  • 2022.7.20 vdom(虚拟dom)实现
  • 2022.8.3 重写完成

Enjoy!

MIT License Copyright (c) 2022 BugDuck Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

这是一个全新的前端框架,轻量级,适合各种快速开发 展开 收起
JavaScript 等 4 种语言
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/BugDucker/tntjs.git
git@gitee.com:BugDucker/tntjs.git
BugDucker
tntjs
tntjs
main

搜索帮助

Cb406eda 1850385 E526c682 1850385