0.2.5 • Published 2 months ago

mttk-vue-wrap v0.2.5

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

Mttk Vue Wrap

What is it?

This project implement Vue3 component with pure Javascript instead of Single-File Component(SFC) and could co-work with SFC together. Generally a vue component includes tempalte/v-model/props/event/slot/method, this project will try to convert them to script with the same functionalities. So developer could config a component with Javascript rather than to write a full SFC.

This project incldues two projects:

We recommend to preview the project first and then read the Developer Manual

Project preview

A live preview of the demo project is available here Not available yet

Demo project Setup

Fork the demo project and then install with the below commands and then enjoy.

npm install
npm run dev

Quick start

This project render vue compent from a JSON-like object. Below is sample config to render a element plus input controller.

export const valueInput = ref("InitValue");

//A simple input configuration
export const configInput ={
    '~component': "ElInput",
    '~modelValue': valueInput,
    placeholder: "Please input value",
    clearable: true}

Then use MttkWrapComp to render

<MttkWrapComp :config="configInput"></MttkWrapComp>

Benifit

SFC includes template/script and style, but these three parts are quite different technologies during coding stage. The idea of this project is to use pure script(javascript/typescript) to warpping a component. Script is easy to combine/transform/resue so more flexiblity could be gain. For example to add a table component into page, using SFC means to add a el-table and config el-column one by one, the code is long and mixed with template/script; by using this project, a simple pice of JS is enough.

And in the real project we may not care about all the features of the component, so configuration could be simplified and then use a piece of translation code to generate the config of the standard format. Refer to sample table/form/app1 for more detail.

And normally 80% pages are quite similar or they could be summarized into several templates in a real project. So we could define the discrepancy into a config file, and then render the page according to the configuration. Refer to sample app1 for more detail.

And this project is also the fundamental technology of MTTK low code.

Restriction

Type script is not well supported. Some Vue 3 features can not not supported,refer to developer manual for more detail.

0.2.5

2 months ago

0.2.4

4 months ago

0.2.3

5 months ago

0.2.2

5 months ago

0.2.1

5 months ago

0.2.0

6 months ago

0.1.9

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago